标题:lable绑定数据库字段出异常
取消只看楼主
jackrebel
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2006-4-21
 问题点数:0 回复次数:1 
lable绑定数据库字段出异常

代码如下:
DataSet ds=new DataSet();
int id=Convert.ToInt32(Request.Form["a23"]);
SqlDataAdapter Adapter=new SqlDataAdapter("select * from dpst where id="+id,con);
Adapter.Fill(dpst,"dpst");
this.Label11.Text=ds.Tables["dpst"].Rows[0].ItemArray[8].ToString()
this.DataBind();

我是将数据表字段绑定到lable,怎么样提示

Exception Details: System.IndexOutOfRangeException: There is no row at position 0.


红色的那一句有错吗?是这样绑定的吧?

补充:在sql语句中不加where可以。

我现在是想用上个页面带过来的参数做条件.谁能给点提示.感谢


搜索更多相关主题的帖子: 绑定 数据库 lable 字段 DataSet 
2007-05-23 15:29
jackrebel
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2006-4-21
得分:0 
问题解决了。谢谢大家

在代码中打滚
2007-05-24 13:35



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




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

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