Pls see my code.Nothing is displaying in the grid

Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Dim connString As String = "Provider=SQLOLEDB;Data Source=MSALAMEEN;uid=sa;pwd=Sa1;Initial Catalog=Biometric"
        Dim myConnection As OleDbConnection = New OleDbConnection
        myConnection.ConnectionString = connString
        Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select ID from bdata", myConnection)
        Dim ds As DataSet = New DataSet
        Dim dc1 As DataColumn = New DataColumn
        'da.Fill(ds)
        da.Fill(ds, "bdata")
        dc1 = ds.Tables("bdata").Columns("id")
        DataGridView1.DataSource = ds.DefaultViewManager

add this at the end.
DataGridView1.DataBind()

regards

@jbisono: add this at the end. DataGridView1.DataBind()
No, It's not working. It is for ASP.NET.

DataGridView1.DataSource = ds.Table("bdata")

Oops that is true adatapost my bad.
thanks for correcting me.

Pls see my code.Nothing is displaying in the grid

Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Dim connString As String = "Provider=SQLOLEDB;Data Source=MSALAMEEN;uid=sa;pwd=Sa1;Initial Catalog=Biometric"
        Dim myConnection As OleDbConnection = New OleDbConnection
        myConnection.ConnectionString = connString
        Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select ID from bdata", myConnection)
        Dim ds As DataSet = New DataSet
        Dim dc1 As DataColumn = New DataColumn
        'da.Fill(ds)
        da.Fill(ds, "bdata")
        dc1 = ds.Tables("bdata").Columns("id")
        DataGridView1.DataSource = ds.DefaultViewManager

Try this,
After the last line add DataGridView1.DataMember = "bdata"

commented: Yes, it is. +11
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.