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

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

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

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"

Comments
Yes, it is.
This article has been dead for over six months. Start a new discussion instead.