标签:
String connString = "Data Source = localhost; Initial Catalog = hkjc;User ID = sa;Pwd = 123";
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = new SqlCommand("GetManagement", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@management", SqlDbType.VarChar, 50).Value = managementname;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt=new DataTable();
sda.Fill(dt);
cmd.Dispose();
cmd.Clone();
conn.Dispose();
conn.Close();
return dt;
注:GetManagement为存储过程名称 @management为参数名称
标签:
原文地址:http://www.cnblogs.com/MyBeN/p/4431212.html