How to use data reader in vb.net?

Dim objcon As New OleDb.OleDbConnection(WindowsApplication1.My.Settings.db2_2010ConnectionString)
        objcon.Open()
        Dim cmd As New OleDb.OleDbCommand("select * from emp", objcon)
        Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader()
        While (dr.Read())
            ListBox1.Items.Add(dr.Item("eno").ToString() + "--" +dr.Item("ename").ToString())
        End While
        objcon.Close()


Average Rating (0)
by Karan   Pande  in VB.Net  on 3/4/2015 2:16:48 AM  


Post Your Comment
*