Select with Sybase OleDb provider

Joined
Feb 4, 2008
Messages
1
Reaction score
0
I have an ASP.NET app in which I am running various queries against a Sybase database using the Sybase ASE Ole Db provider. I cannot get results from a Select query.

I can do an Insert query, running the command as a non-query and it works fine. I can run a Select as a non-query and that also works but of course that doesn't provide a mechanism to access the results.

When I run the select command from a data reader, the page seems to hang and never returns anything. Here's what I'm using for the Select from the data Reader:

Dim objThisConnection As OleDbConnection
Dim objThisCommand As OleDbCommand
Dim objThisReader As OleDbDataReader
Dim strSQL As String
objThisConnection = New OleDbConnection("Provider=Sybase ASE OLE DB Provider;Server Name=primary,2025;User ID=javaApp;Password=javaApp")
objThisConnection.Open()
strSQL = "select dealerID from cssrpt..tblCustRequirements"
objThisCommand = New OleDbCommand(strSQL,objThisConnection)
'objThisCommand.ExecuteNonQuery() 'this line works if I run it in place of the next line
objThisReader = objThisCommand.ExecuteReader()
objThisReader.Close
objThisConnection.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top