public DataSet GetData(string Query)
{
try
{
if (ds.Tables.Count > 0)
{
ds.Tables.Clear();
}
SqlDataAdapter adp = new SqlDataAdapter(Query, con);
adp.Fill(ds,
"s");
return ds;
}
catch (Exception)
{
throw;
return ds;
}
}
public DataSet GetData(string Query)
{
try
{
if (ds.Tables.Count > 0)
{
ds.Tables.Clear();
}
SqlDataAdapter adp = new SqlDataAdapter(Query, con);
adp.Fill(ds,
"s");
return ds;
}
catch (Exception)
{
throw;
return ds;
}
}
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.
Ravi ShekharPosted Jun 24, 2013, 7:11 AM
public DataSet GetData(string Query)
{
try
{
SqlDataAdapter adp = new SqlDataAdapter(Query, con);
adp.Fill(ds,"s");
return ds;
}
catch (Exception)
{
throw;
ds.Tables.Clear();
return ds;
}
}
Now call GetData method
DataSet ds=new DataSet();
ds= GetData("select * from table");
Pankaj PandeyPosted Jun 24, 2013, 6:15 AM