SqlConnection conn = new SqlConnection("server =" + server + ";database = " + database + ";uid =" + uid + ";pwd =" + pwd);
conn.Open();
SqlCommand MyCommand = new SqlCommand("GroupKPIS", conn);
MyCommand.CommandType = CommandType.StoredProcedure;
MyCommand.Parameters.Add(new SqlParameter("@swhere", SqlDbType.NText));
MyCommand.Parameters["@swhere"].Direction = ParameterDirection.Input;
MyCommand.Parameters["@swhere"].Value = sWhereString;
SqlDataAdapter da = new SqlDataAdapter(MyCommand);//获取存储过程返回的表
DataSet dst = new DataSet();
da.Fill(dst);
|