Hi,
1.Drag and drop a gridview in your aspx page/form.
2.Give id to your gridview.
3.Build a select query and use sql adapter to get the dataset from the backend.
Then bind it as datasource to your grid view.
Here is a example
Public Class Form1
Dim connectionString As String = "server=SYS2;" + "integrated security=SSPI;" +
"database=FinAccounting"
Dim str_Account_Select As String = "SELECT * FROM AccountsTable "
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim myAdapter As SqlDataAdapter
Dim myDataSet As DataSet
Private Sub LoadData()
myConnection = New SqlConnection(connectionString)
myCommand = New SqlCommand(str_Account_Select, myConnection)
myConnection.Open()
myDataSet = New DataSet()
myAdapter = New SqlDataAdapter()
myAdapter.SelectCommand = myCommand
myAdapter.Fill(myDataSet, "AccountsTable")
If (myDataSet.Tables("AccountsTable").Rows.Count = 0) Then
MessageBox.Show("There are currently no registries in the database.")
Else
DataGridView1.DataSource = myDataSet.Tables("AccountsTable")
End If
End Sub
End Class
Customize your select query accordingly.
Hope this helps
For Connection String-
www.connectionstrings.com/[
^]
~Edit~
~Added link~