hello;
how we can create dataset of existing table in sqlserver2000 using c# n asp.net. because my application is based on crystal reporting.
regards,
sumaira
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Jan 28, 2012, 10:52 PM
Krishna GaradPosted Jan 28, 2012, 4:32 AM
Private DataSet CreateDS()
{
//connection object
SqlConnection cn=new SqlConnection("U r ConnectionString");
//command object
SqlCommand cmd=new SqlCommand("Select * from TableName",cn);
//create dataset
DataSet ds=new DataSet();
//call adapter
SqlDataAdapter da=new SqlDataAdapter(cmd);
//fill the dataset
da.Fill(ds);
return ds;
}
I hope this will help you.