主题:一个不大不小的问题!
kskksk
[专家分:620] 发布于 2005-11-27 23:33:00
怎么把数据库里的多条记录传到listbox里
运行环境是VS.NET2003.
谢谢!!1[em18]
回复列表 (共2个回复)
沙发
宝宝啊呜 [专家分:990] 发布于 2005-11-28 15:52:00
For....Next 语句
板凳
kskksk [专家分:620] 发布于 2005-11-28 21:44:00
Dim tablename As String = "couset"
searchSQL = "select * from couset where zy='" & ComboBox1.Text & "'"
ExecuteSQL(searchSQL, tablename)
Dim newrow As DataRow
newrow = mytable.NewRow
Dim sql As String
Dim i As Int16
For i = 1 To .........???
newrow.Item(1) = Trim(ComboBox1.Text)
newrow.Item(2) = Trim(ListBox2.Items.Item(i))
mytable.Rows.Add(newrow)
Next
怎么在这里得到记录的总数??
是不是要用sql语句得到??
怎么写??
谢谢!!
我来回复