帮忙解释一下这点代码

来源:百度知道 编辑:UC知道 时间:2024/07/07 16:44:38
string countcredit;
string fee;
int a;
while (selreader.Read())
{
if(selreader.GetValue(0)!=System.DBNull.Value)
{
countcredit=selreader.GetValue(0).ToString();
a=Int32.Parse(countcredit)*50;
fee=a.ToString();
}
}

//宣告变量
string countcredit;
string fee;
//字符串类型变量 countcredit, fee
int a;
//整数类型变量 a
while (selreader.Read())
//循环读取selreader输入值
{
if(selreader.GetValue(0)!=System.DBNull.Value)
//若输入值首字节不等于系统数据库空值=>若不为空字符串/字符串长度大于0
{
countcredit=selreader.GetValue(0).ToString();
//输出selreader输入值为字符串类型并付值于countcredit
a=Int32.Parse(countcredit)*50;
//将十六进制整数的字符串countcredit转换成十进制整数,并放大50倍付值于a
fee=a.ToString();
//将整数变量a转换成字符串countcredit付值于fee
}
}

//估计此段代码在不断循环地读取操作者输入字符串,提取其中的十六进制整数的字符串转换成十进制整数,并放大50倍,再以字符串类型输出至内存变量中,没有实际的输出或应用处理过的数据

这个问题应该首先知道selreader是什么吧?
这样看比较辛苦!

selreader很明显是sqldatareader