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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 24, 2013, 2:15 AM EDT
Ravi ShekharRank #673 · 3.6K reputationPosted Jun 24, 2013, 3:11 AM EDT
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");