I am using Visual Studio 2008; I am executing one query and its results are coming in the datareader dr1; I have checked this in debug window. Even though values are coming inside datareader it's read property dr1.read() is coming false. How is this happening. How do i remove this bug
SqlDataReader dr1.Read() coming false
Collapse
X
-
Tags: None
-
The resulting values of query comes in dr1. in debugger under the haeding
Result View-> [0]-> Non-public members-> _values. And still dr1.read() is coming false.People plz reply. This is urgent. -
Show the code you're using for this task and we will have a better idea on why this is happening.Comment
-
Code:query1="select username,date,subject,description from doubts where heading='" + strheading + "'" con.Open(); SqlCommand cmd1= new SqlCommand(query1,con); SqlDataReader dr1; dr1=cmd1.ExecuteReader();
Comment
-
For future reference if you have a column name that's a reserved word when you query it put brackets around it, like this [date]Comment
-
-
Comment