public override DataSet exeProcForDataSet(string procName,string[] strParams,object[] strValues)
{
SqlCommand cmd=new SqlCommand();
if((strParams!=null)&&(strParams.Length!=strValues.Length))
throw new ParamValueNotMatch("查询参数和值不对应!");
if(strParams!=null)
{
for(int i=0;i<strParams.Length;i++)
cmd.Parameters.Add(strParams[i],strValues[i]);
}
cmd.Connection=this.conn;
if(inTransaction)
cmd.Transaction=trans;
DataSet ds= new DataSet();
SqlDataAdapter adapter= new SqlDataAdapter();
cmd.CommandType=CommandType.StoredProcedure;
cmd.CommandText=procName;
adapter.SelectCommand=cmd;
adapter.Fill(ds);
return ds;
}
{
SqlCommand cmd=new SqlCommand();
if((strParams!=null)&&(strParams.Length!=strValues.Length))
throw new ParamValueNotMatch("查询参数和值不对应!");
if(strParams!=null)
{
for(int i=0;i<strParams.Length;i++)
cmd.Parameters.Add(strParams[i],strValues[i]);
}
cmd.Connection=this.conn;
if(inTransaction)
cmd.Transaction=trans;
DataSet ds= new DataSet();
SqlDataAdapter adapter= new SqlDataAdapter();
cmd.CommandType=CommandType.StoredProcedure;
cmd.CommandText=procName;
adapter.SelectCommand=cmd;
adapter.Fill(ds);
return ds;
}