public static DataSet GetDataset(string sqlQuery)
{
// Open the connection in a try/catch block.
// Create and execute the DataReader, writing the result
// set to the console window.
try
{
using (SqlConnection connection = new SqlConnection(ConnectionString))
{
SqlDataAdapter adapter = new SqlDataAdapter(sqlQuery, connection);
DataSet ds = new DataSet();
adapter.Fill(ds, "ResultDS");
return ds;
}
}
catch (Exception ex)
{
throw (ex);
}
}