Thursday, October 31, 2013

VB.Net Get Data From SQL Server & Display in DataGridView (OLEDB)

VB.Net Get Data From SQL Server & Display in DataGridView (OLEDB)

VB.Net, by admin. Code below for retrieve data from SQL Server and display in DataGridView.
Dim da As OleDb.OleDbDataAdapter
Dim SQL As String
Dim dt As New DataTable
SQL = “Select * From TableName”
da = New OleDb.OleDbDataAdapter(SQL, conn)
da.Fill(dt)
DataGridView1.DataSource = dt

Source: http://it-solve.hostoi.com/?p=175

No comments: