public SqlDataReader GetProductCategories()
{ // Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection("server=localhost;Trusted_Connection=true;database=Commerce");
SqlCommand myCommand = new SqlCommand("CMRC_ProductCategoryList", myConnection); // Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.Parameters.Add("@CartID",SqlDbType.NVarchar,50);
myCommand.Parameters["@CartID"].Value=CartID;
// Execute the command
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection); // Return the datareader result
return result;
}
{ // Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection("server=localhost;Trusted_Connection=true;database=Commerce");
SqlCommand myCommand = new SqlCommand("CMRC_ProductCategoryList", myConnection); // Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.Parameters.Add("@CartID",SqlDbType.NVarchar,50);
myCommand.Parameters["@CartID"].Value=CartID;
// Execute the command
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection); // Return the datareader result
return result;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货