回 帖 发 新 帖 刷新版面

主题:一个不大不小的问题!

怎么把数据库里的多条记录传到listbox里
运行环境是VS.NET2003.
谢谢!!1[em18]

回复列表 (共2个回复)

沙发

For....Next 语句

板凳

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语句得到??
怎么写??
谢谢!!

我来回复

您尚未登录,请登录后再回复。点此登录或注册