SQL Statement in vb.net app is returning unexpected results.
Posted on 2006-05-19
I am using a vb.net console app to transfer data to/from an asp.net site. I am using the following to create a dataset. I have tried Xferstatus as an integer and as text, but do not get any records returned.
The number of records returned is 0, although there are two records that meet the criteria. If I drop the 'Where" clause, all records are returned. If I run the statement from Enterprise Manager, I get the correct records returned.
Here is the complete statement:
Dim dsRequests As New DataSet
Dim da As New SqlDataAdapter(cmdSQL)
Dim newS As Integer = s - 1
cmdSQL.CommandText = "SELECT * FROM WorkRequests WHERE XferStatus = 0;"
Catch ex As Exception
strLogMsg = "Error in GetRequests"
strExceptMsg = ex.Message
ReqError = True
NoException = False
If cmdSQL.Connection.State = ConnectionState.Open Then cmdSQL.Connection.Close()
If NoException Then
If dsRequests.Tables(0).Rows.Count = 0 Then
In this case, count = 0 and it should be 2.