I am trying to populate combobox from access database but not geting populated

only message 1 is displayed message 2 ,3 & 4 are not displayed, nither any eror is shown

Imports System.Data.OleDb

Public Class FrmPlPostCodeNl
Public acsconn As New OleDb.OleDbConnection
Public acsdr As OleDbDataReader
Public strSql As String

Private Sub FrmPlPostCodeNl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
acsconn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;data source = D:\Shabeeb\SSS.accdb"
acsconn.Open() '"
strSql = "Select * from NLCODES"
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strSql
acscmd.Connection = acsconn
acsdr = acscmd.ExecuteReader
While (acsdr.Read())
End While

End Sub

Recommended Answers

All 2 Replies

Try using the GetValue method and the ordinal position of the field you want from the query.
This would be "Select Field From Table" you are requesting 1 field so that's position 0


its not working

Be a part of the DaniWeb community

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