如何把dataset的数据赋值给list? 不要用循环,谢谢。list1.AddRange()??谁知道,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 假设DataSet的Table[0]有两列Text和Valuethis.ListBox1.DataSource = ds.Tables[0].DefaultView; this.ListBox1.DataTextField = "Text"; this.ListBox1.DataValueField = "Value"; this.ListBox1.DataBind(); 哥们,我说的是LIST不是LISTBOXDA层用不了LISTBOX的 你的这个list到底是什么类型的?是像ListBox,ListView那样的控件,还是一种数据类型? list是类型,谢谢。属于System.Collections.Generic空间 dataset好像没有默认的copy到string数组的函数你又要不用循环所以只好先把datarow赋值到list取的时候用datarow对象取 DataSet ds = new DataSet(); DataRow[] datarows = ds.Tables[0].Select(); ICollection collection = (ICollection)datarows; ArrayList al = new ArrayList(); al.AddRange(collection); Response.Write(((DataRow)al[0])[0].ToString()); 当前上下文中不存在名称XXX C# 导出PDF格式的文件,输出到浏览器上 请问:FF下XPath的用法 sql查询并数据绑定问题。 编程求助:怎样把sql中的数据写入excel呢? 一个大问题:PrintDocument类到底是在服务器端打印还是在客户端打印? ASP.net中 如何用 C# 调用含有参数的Javascript函数 如何用C#判断一变量是否为空?在线等 当目录中文件数量很多时,会不会使调用某个素材的web页效率受影响? 俺自己写的万能查询的存储过程,请赐教 大家看看伟大验证代码那里出错了? ~~~~~今天老遇怪事~~~~
this.ListBox1.DataSource = ds.Tables[0].DefaultView;
this.ListBox1.DataTextField = "Text";
this.ListBox1.DataValueField = "Value";
this.ListBox1.DataBind();
是像ListBox,ListView那样的控件,还是一种数据类型?
你又要不用循环所以只好先把datarow赋值到list
取的时候用datarow对象取 DataSet ds = new DataSet();
DataRow[] datarows = ds.Tables[0].Select();
ICollection collection = (ICollection)datarows;
ArrayList al = new ArrayList();
al.AddRange(collection); Response.Write(((DataRow)al[0])[0].ToString());