Combobox代码
不可编辑代码:
ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
动态添加代码:
写在前面的语句:
Imports System.Data
Imports System.Data.OleDb
――――――――――――――――
连接语句:
Private ds1 As DataSet = New DataSet
Private strcon As String = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=storehouse;User ID=sa;Password=sa"
Public DBcon As New OleDbConnection(strcon)
―――――――――――――――――
DBcon.Open()
Dim sqlStr As String = "SELECT 动态添加的列 FROM 动态添加的表"
Dim adt As New OleDbDataAdapter(sqlStr, DBcon)
ds1.Clear()
――――――――――――――――――