那位大神帮我解释一下c# asp.net 代码!!
publicstaticSqlDataReaderExeProcDataReader(stringszProcName,object[]objParms){Databas...
public static SqlDataReader ExeProcDataReader(string szProcName, object[] objParms)
{
Database.CheckExpire();
SqlConnection sqlConnection = new SqlConnection(Database.CONN_STRING);
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.set_CommandText(szProcName);
sqlCommand.set_Connection(sqlConnection);
sqlCommand.set_CommandType(4);
sqlConnection.Open();
if (objParms != null)
{
SqlCommandBuilder.DeriveParameters(sqlCommand);
int num = 0;
while (num < sqlCommand.get_Parameters().get_Count() && num < objParms.Length)
{
sqlCommand.get_Parameters().get_Item(num).set_Value(objParms[num]);
num++;
}
}
SqlDataReader result = sqlCommand.ExecuteReader(32);
int num2 = 0;
while (num2 < sqlCommand.get_Parameters().get_Count() && num2 < objParms.Length)
{
if (sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 3 || sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 2 || sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 6)
{
objParms[num2] = sqlCommand.get_Parameters().get_Item(num2).get_Value();
}
num2++;
}
return result;
}
----------------------------------分割线----------------------------------
CheckExpire(); 只是检验
是否到了试用期,没有重要的东西。 展开
{
Database.CheckExpire();
SqlConnection sqlConnection = new SqlConnection(Database.CONN_STRING);
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.set_CommandText(szProcName);
sqlCommand.set_Connection(sqlConnection);
sqlCommand.set_CommandType(4);
sqlConnection.Open();
if (objParms != null)
{
SqlCommandBuilder.DeriveParameters(sqlCommand);
int num = 0;
while (num < sqlCommand.get_Parameters().get_Count() && num < objParms.Length)
{
sqlCommand.get_Parameters().get_Item(num).set_Value(objParms[num]);
num++;
}
}
SqlDataReader result = sqlCommand.ExecuteReader(32);
int num2 = 0;
while (num2 < sqlCommand.get_Parameters().get_Count() && num2 < objParms.Length)
{
if (sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 3 || sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 2 || sqlCommand.get_Parameters().get_Item(num2).get_Direction() == 6)
{
objParms[num2] = sqlCommand.get_Parameters().get_Item(num2).get_Value();
}
num2++;
}
return result;
}
----------------------------------分割线----------------------------------
CheckExpire(); 只是检验
是否到了试用期,没有重要的东西。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询