怎么复制一个SqlDataReader
1个回答
展开全部
string cnn = ConfigurationManager.ConnectionStrings["ReportDataService"].ConnectionString;
using (SqlConnection cn = new SqlConnection())
{
cn.ConnectionString = cnn;
cn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "p_OrderDetailExecute";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@SupplierID", SupplierID);
using (var reader = cmd.ExecuteReader())
using (SqlConnection cn = new SqlConnection())
{
cn.ConnectionString = cnn;
cn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "p_OrderDetailExecute";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@SupplierID", SupplierID);
using (var reader = cmd.ExecuteReader())
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询