标题:请问asp中读取数据用的rs("字段名"),在asp.net中怎么表示?
只看楼主
garyboy520
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2006-5-16
 问题点数:0 回复次数:2 
请问asp中读取数据用的rs("字段名"),在asp.net中怎么表示?
请问asp中读取数据用的rs("字段名")
在asp.net中怎么表示?

conn.open();
StrSql="select * from cpjs where id="+Request.QueryString["id"];
OleDbCommand mycommand=new OleDbCommand(StrSql,conn.dbconn);
OleDbDataReader myReader=mycommand.ExecuteReader();
if(myReader.Read())
{
this.fzmz1.Text=myReader["fzmz"];
~~~~~~~~~~~~~~
}
else
{
Response.Write ("<script>alert('当前没有记录,请返回!!');history.go(-1);</script>");
}
搜索更多相关主题的帖子: 字段名 net中 asp中 数据 
2006-05-22 08:40
铲铲
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:506
专家分:0
注 册:2006-5-2
得分:0 
使用object DataReader.GetValue[int index]或者object DataReader.GetValue[string index]

while (DataReader.Read())
{
try
{
this.string1 = (string)DataReader.GetValue["fzmz"];
}
catch
{
//Catch any exceptions here
}
}

铲铲是也
2006-05-22 11:04
garyboy520
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2006-5-16
得分:0 
谢谢您~!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2006-05-22 15:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-66147-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.640120 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved