Hi,
When I execute queries which have a lot of data returned in the recordset my VB app seems to hang (IE: This program is not responding)
I'm using ODBC to connect to the database and am using Postgres DB
Public db_name As String
Public db_username As String
Public db_userpassword As String
Public db_server As String
Public connStr As String
Public sqlCommand As OdbcCommand
Public sqlConn As OdbcConnection
Public Rs As OdbcDataReader
Public Sub DoQuery(ByVal tmpSQL as String)
connStr = "Driver={PostgreSQL ANSI};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
sqlCommand = New OdbcCommand
sqlConn = New OdbcConnection(connStr)
If sqlConn.State = ConnectionState.Closed Then
sqlConn.Open()
End If
sqlCommand.CommandType = CommandType.Text
sqlCommand.Connection = sqlConn
sqlCommand.CommandText = tmpSQL
Rs = sqlCommand.ExecuteReader
End Sub
I'm not sure that there is a way to sort this out, I hope there is?
Thanks all!