日期:2014-05-17 浏览次数:21028 次
public DataSet GetPuchRecp(string sPuchrecpCode)
{
string sql = ConfigurationManager.ConnectionStrings["FEDZWEBtest"].ToString() ;
SqlConnection sqlCon = new SqlConnection(sql) ;
DataSet ds = new DataSet() ;
SqlCommand cmd = new SqlCommand("sp_BS_PuchRecpTOEFLY", sqlCon) ; //sp_BS_PuchRecpTOEFLY 存储过程
cmd.CommandType = CommandType.StoredProcedure;
//@sPuchrecpCode 存储过程中的参数
cmd.Parameters.Add(new SqlParameter("@sPuchrecpCode", SqlDbType.VarChar, 8));
cmd.Parameters["@sPuchrecpCode"].Direction = ParameterDirection.Input;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(ds);
return ds;
}
public DataSet GetPuchRecp(string sPuchrecpCode)
{
string sql = ConfigurationManager.ConnectionStrings["FEDZWEBtest"].ToString() ;
SqlConnection sqlCon = new SqlConnection(sql) ;
DataSet ds = new DataSet() ;
SqlCommand cmd = new SqlCommand("sp_BS_PuchRecpTOEFLY", sqlCon) ;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@sPuchrecpCode", SqlDbType.VarChar, 8)); //增加并定义参数@sPuchrecpCode
cmd.Parameters["@sPuchrecpCode"].Value = sPuchrecpCode; //传入参数 @sPuchrecpCode的值
cmd.Connection.Open();
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(ds);
return ds;
}