string strsql = "select * from test";
string cnn = @"Data Source=.\sqlexpress;Initial Catalog=test;Integrated Security=True";
DataSet ds = SqlHelper.ExecuteDataset(cnn, CommandType.Text, strsql);
MessageBox.Show(ds.Tables[0].Rows.Count.ToString());
// Create & open a SqlConnection, and dispose of it after we are done
using (SqlConnection connection = new SqlConnection("server=pc-200809301746;Database=test;Integrated Security=True"))
{
connection.Open();
CommandTpe ct;
CommandText ctxt;
// Call the overload that takes a connection in place of the connection string
return ExecuteDataset(connection, CommandType commandType, CommandText commandText, commandParameters);
}