#region 定义新SqlConnection,SqlCommand...........
SqlConnection con;
SqlCommand com;
SqlDataAdapter adpt;
DataSet ds;
SqlDataReader dr;
#endregion
#region 连接数据库
public sqldb()
{
con = new SqlConnection();
com = new SqlCommand();
adpt = new SqlDataAdapter();
ds = new DataSet();
//dr = new SqlDataReader();
con.ConnectionString = ConfigurationSettings.AppSettings["guo752"];
}
#endregion
#region 执行存储过程
public void execProc(string procName, SqlParameter[] Params)
{
con.Open();
com = new SqlCommand(procName, con);
com.CommandType = CommandType.StoredProcedure;
foreach(SqlParameter parameter in Params)
{
com.Parameters.Add(parameter);
}
com.ExecuteNonQuery();
con.Close();
}
#endregion