日期:2014-05-17 浏览次数:20447 次
class SqlHelper { private static readonly string connstr = ConfigurationManager.ConnectionStrings["lkfCon"].ConnectionString; public int ExecuteNonQuery(string cmdText, params SqlParameter[] parameters) { using (SqlConnection con = new SqlConnection(connstr)) { con.Open(); using (SqlCommand cmd = con.CreateCommand()) { cmd.CommandText = cmdText; cmd.Parameters.AddRange(parameters); return cmd.ExecuteNonQuery(); } } } }