Hi there,
I'm new to vb and I need to a thing. I've made a simple form by using vb.net. There I entered a combobox and I connected it to a access database. But when I'm running the program, when I click the drop down mark I won't get the details from the connected database. Can somebody tell me what's the wrong with my code?
here is the code
My vb version is vb 2005 express edition.
I'm new to vb and I need to a thing. I've made a simple form by using vb.net. There I entered a combobox and I connected it to a access database. But when I'm running the program, when I click the drop down mark I won't get the details from the connected database. Can somebody tell me what's the wrong with my code?
here is the code
Imports System.Data
Public Class Form1
Dim inc As Integer
Dim MaxRows As Integer
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "PROVIDER = Microsoft.ace.oledb.12.0;data source = ItemList.accdb"
con.Open()
sql = "SELECT * FROM Item_List"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "ItemList")
con.Close()
MaxRows = ds.Tables("ItemList").Rows.Count
inc = -1
End Sub
End Class
My vb version is vb 2005 express edition.