VB.NET中DataGridView控件怎么使用
如何用代码实现数据的绑定,我写了一个,可以连接到表,可是却不显示数据!大家帮帮忙吧!DimconnAsOleDbConnectionDimdataTableAsOleDb...
如何用代码实现数据的绑定,我写了一个,可以连接到表,可是却不显示数据!大家帮帮忙吧!
Dim conn As OleDbConnection
Dim dataTable As OleDbDataAdapter
Dim dataSet As DataSet
Dim strSQL As String
Private Sub oprData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
conn = New OleDbConnection()
conn = getDB_Conn()
'conn.Open()
strSQL = "select * from sys_hairstyle"
dataTable = New OleDbDataAdapter(strSQL, conn)
dataSet = New DataSet
dataTable.Fill(dataSet)
DataGridViewInfo.DataSource = dataSet.Tables(0)
DataGridViewInfo.AutoResizeRows()
conn.Close()
End Sub
希望高手能给出使用操作的源代码是最好不过啦! 展开
Dim conn As OleDbConnection
Dim dataTable As OleDbDataAdapter
Dim dataSet As DataSet
Dim strSQL As String
Private Sub oprData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
conn = New OleDbConnection()
conn = getDB_Conn()
'conn.Open()
strSQL = "select * from sys_hairstyle"
dataTable = New OleDbDataAdapter(strSQL, conn)
dataSet = New DataSet
dataTable.Fill(dataSet)
DataGridViewInfo.DataSource = dataSet.Tables(0)
DataGridViewInfo.AutoResizeRows()
conn.Close()
End Sub
希望高手能给出使用操作的源代码是最好不过啦! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询