公共方法静态
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(); }
人各有命,上天注定,有人天生为王,有人落草为寇。脚下的路,如果不是你自己的选择,那么旅程的终点在哪,也没人知道。你会走到哪,会遇到谁,都不一定。