public static string connectionString = ConfigurationManager.ConnectionStrings["Connection eStore"].ToString(); public static DataSet ExeQuery_eStore(string Cmd) { using (SqlConnection con = new SqlConnection(connectionString)) { SqlDataAdapter da = new SqlDataAdapter(); SqlCommand command = new SqlCommand(Cmd, con); con.Open(); da.SelectCommand = command; DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return ds; } } public static void ExeNonQuery_eStore(string cmd) { SqlConnection con = new SqlConnection(); con.ConnectionString = connectionString; con.Open(); SqlCommand com = new SqlCommand(); com.Connection = con; com.CommandType = CommandType.Text; com.CommandText = cmd; SqlDataReader dr = com.ExecuteReader(); dr.Close(); con.Close(); }