Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SqlDataAdapter da = new SqlDataAdapter(q,constr);
DataTable dt = new DataTable();
da1.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
Posted
Comments
Animesh Datta 8-Apr-14 3:44am    
what is the error ? is it in 3rd line , as you have taken one SqlDataAdapter object named as da , but you have used da1 ?

improve your question .

1 solution

With just that code fragment and no error message, it's pretty much impossible to tell, but it's likely that you are using the wrong DataAdapter.
Try:
C#
SqlDataAdapter da = new SqlDataAdapter(q,constr);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
And if that doesn't work, we would need the error message, and the line it is complaining about.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900