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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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