Null in a Column when there is data

  • Thread starter Thread starter John Mark Howell
  • Start date Start date
J

John Mark Howell

I'm running .Net v1.1, C# against a SQL Server 2000 db.
I've got a stored procedure that returns multiple columns. All but the
first column are numeric(18,6). I have the standard
SqlConnection/SqlCommand/SqlDataAdapter calls to retrieve the data and
simply display in a DataGrid. The first three numeric columns are all null
and many of the others appear to be null. However, when I run the same
query in the Query Analyzer, all the data is coming back. I have even
checked one of the columns (eg. dataSet.Tables[0].Rows[0][2]) and it returns
System.DBNull when I know there is data there. Anybody have any ideas???
 
I just wanted everyone to know that the bug was really in the stored proc.
There was a subtle SQL error that does not show itself when you execute the
proc through Query Analyzer but does when you call it form SqlClient. Just
one more fun thing to watch out for. :)
 
Back
Top