Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void btnload_Click(object sender, EventArgs e)
{
String cs = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(cs);
SqlDataAdapter da = new SqlDataAdapter("Select * from tblEmployee Where Id =" + TextBox1.Text,con);
Dataset dset = new Dataset();
// da.Fill(dset, "tblEmployee");// in this line iam getting the error why? please help me out


}

Thanks in advance
Posted
Comments
[no name] 9-Oct-14 0:14am    
May i know what error you are getting?

1 solution

Here you are having only one table in that ds dset right,so why dont you try
C#
da.Fill(dset)

or you can use
C#
da.Fill(dset.Tables["tblEmployee"])


And i suggest you to use datatables instead of ds. It will make a negative impression in the performance if you ra using dataset. Use dataset only in the needs.

read more here

http://msdn.microsoft.com/en-us/library/905keexk%28v=vs.110%29.aspx[^]

http://msdn.microsoft.com/en-us/library/ms171920.aspx[^]
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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