Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a typed dataset.

But When I call in the front end records in the tables are not displaying


C#
con.Open();

     TypedDataSet tds = new TypedDataSet();
     cmd.ExecuteNonQuery();
     DataTable dt;
     dt = tds.Tables[0];
     dgvServer.DataSource = dt;
     dgvServer.Refresh();

con.Close();
Posted
Comments
PIEBALDconsult 30-Jun-14 1:04am    
Maybe the ExecuteNonQuery part?
KUMAR619 30-Jun-14 1:08am    
Can you help me to use typed dataset to display in grid view.
Suvabrata Roy 30-Jun-14 2:18am    
http://msdn.microsoft.com/en-us/library/esbykkzb(v=vs.110).aspx

Where you set the TypedDataSet
I think its throwing some error of Out of bound

First set the dataset then use it.

Or Please post the full code block
 
Share this answer
 
v2
Hi I hope you are missing dataadapter to fill dataset


SQL
TypedDataSet tds = new TypedDataSet();
SqlDataAdapter da=new SqlDataAdapter("Your Query");
da.fill(tds);
DataTable dt;
dt = tds.Tables[0];
dgvServer.DataSource = dt;
dgvServer.Refresh();
 
Share this answer
 
Comments
KUMAR619 30-Jun-14 2:44am    
Thanks Bala How to update a dataset content and update to real database
Write dgvServer.DataBind(); just after the code dgvServer.DataSource = dt;
 
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