D
downwitch
Hi,
I'm having trouble getting data in ADO.Net recordsets. (VS 2005, SQL
Server 2005). All my rowsets come back empty--whether sourced from
queries or stored procs--despite ODBC connections with the same user
credentials (two different UID/PWDs tried) returning existing data
without a problem (i.e. it's not a SQL security problem).
With code like
strSQL = "SELECT * FROM SomeTable"
Dim da As New SqlDataAdapter(strSQL, gcnn)
Dim ds As New DataSet("MyDS")
da.FillSchema(ds, SchemaType.Source)
Dim dr As DataRow
If ds.Tables(0).Rows.Count > 0 Then
For Each dr In ds.Tables(0).Rows
'do something
Next dr
End If
I am getting no data, but there is definitely data there. No errors,
just empty datasets. Is there some better way to go about this? Should
I use a straight ODBC connection instead of trying to use ADO's SQL
adapter?
Hope someone can help me see the error of my ways. I'm a SQL pro but
something of a vb.net newb, and google isn't turning up anything of
use.
I'm having trouble getting data in ADO.Net recordsets. (VS 2005, SQL
Server 2005). All my rowsets come back empty--whether sourced from
queries or stored procs--despite ODBC connections with the same user
credentials (two different UID/PWDs tried) returning existing data
without a problem (i.e. it's not a SQL security problem).
With code like
strSQL = "SELECT * FROM SomeTable"
Dim da As New SqlDataAdapter(strSQL, gcnn)
Dim ds As New DataSet("MyDS")
da.FillSchema(ds, SchemaType.Source)
Dim dr As DataRow
If ds.Tables(0).Rows.Count > 0 Then
For Each dr In ds.Tables(0).Rows
'do something
Next dr
End If
I am getting no data, but there is definitely data there. No errors,
just empty datasets. Is there some better way to go about this? Should
I use a straight ODBC connection instead of trying to use ADO's SQL
adapter?
Hope someone can help me see the error of my ways. I'm a SQL pro but
something of a vb.net newb, and google isn't turning up anything of
use.