大概如下:
string strSQL="select * from sysobjects where xtype='u'";
SqlCommand cmd = new SqlCommand(strSQL, connection);
SqlDataReader myReader;
myReader = cmd.ExecuteReader();
cmd.Fill(datatalbe);
ListBox.dataSource=datatable;
string strSQL="select * from sysobjects where xtype='u'";
SqlCommand cmd = new SqlCommand(strSQL, connection);
SqlDataReader myReader;
myReader = cmd.ExecuteReader();
cmd.Fill(datatalbe);
ListBox.dataSource=datatable;
解决方案 »
- 用C#代码怎么实现通过互联网给手机发短信
- c#写的winform应用程序运行后,为什么鼠标拖动不了窗体?
- 保存客户提交的webservice请求
- 高分求spreadsheet的使用范例
- 急急急
- 错在那里,急在线等待!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 最后10分,在线等:原来datagrid.DataSource = dt.DefaultView;现在我想只绑定dt中的某两行,如何做到?
- 帮个小小忙,关于用.net做论坛时,帖子的总数量的问题
- 想用C#做一个GPS车辆监管软件,请教各位有什么适合的GPS硬件和平台?
- 关于自制控件的问题请教?
- 请教一迷惑的问题,在线等
- ★★★ 如何用C#启动一个非exe扩展名的 应用程序 ?
select ID,showValue
改成这样:
string sqlstr="select name from sysobjects where xtype='u'";
ListBox.dataSource=datatable.Columns["列名"];
ListBox.DataBind();