Powershell using ODBC; putting CommandTimeout parameter into statements

  • I'd like to get the  CommandTimeout=0    into the command below before the   ExecuteReader  is done.

    I haven't found any examples with this type of code showing where to place the  CommandTimeout  parameter.

    Thanks for any help with this.

    ---------------------------------------------------

    $text = "A valid query string that was built"

    $conn = New-Object Data.Odbc.OdbcConnection

    $conn.ConnectionString= "DSN=QDSN"

    $conn.open()

    $result =(new-Object Data.Odbc.OdbcCommand($text,$conn)).ExecuteReader()

    $table = new-object "System.Data.DataTable"

    $table.Load($result)

  • Have a look at this link.

    In order to use CommandTimeout, it seems you will first need to create an OdbcCommand and push your query through that.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Thanks.

    That got me in the right direction to put in similar code in a Powershell script and it now executes.

  • This was removed by the editor as SPAM

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply