/// <summary>
/// 调用存储过程,创建SqlDataReader对象 如select * from 表.在存储结构中实现,应用在读取分类等信息
/// <param name="strProcName">存储过程名</param>
/// <param name="strProResult">返回存储对象</param>
/// </summary>
///this.rpProductType.DataSource = new TDB("SQL").ProGetDataSet("GetClass");
///this.rpProductType.DataBind();
///存储过程示例:CREATE PROCEDURE GetClass AS BEGIN SET NOCOUNT ON; SELECT*FROM productClass END GO
public SqlDataReader ProGetDataSet(string strProcName)
{
try
{
SqlCommand cmd=new SqlCommand(strProcName,this._SqlConnection);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader strProResult=cmd.ExecuteReader(CommandBehavior.CloseConnection);
return strProResult;
}
catch
{
this.CloseConnection();
return null;
}
}
/// 调用存储过程,创建SqlDataReader对象 如select * from 表.在存储结构中实现,应用在读取分类等信息
/// <param name="strProcName">存储过程名</param>
/// <param name="strProResult">返回存储对象</param>
/// </summary>
///this.rpProductType.DataSource = new TDB("SQL").ProGetDataSet("GetClass");
///this.rpProductType.DataBind();
///存储过程示例:CREATE PROCEDURE GetClass AS BEGIN SET NOCOUNT ON; SELECT*FROM productClass END GO
public SqlDataReader ProGetDataSet(string strProcName)
{
try
{
SqlCommand cmd=new SqlCommand(strProcName,this._SqlConnection);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader strProResult=cmd.ExecuteReader(CommandBehavior.CloseConnection);
return strProResult;
}
catch
{
this.CloseConnection();
return null;
}
}