2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by Exelio
0

hi,

Write the following code in form load event

Dim conn As New OleDb.OleDbConnection("Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data Source=C:\Program Files\Microsoft Office\Office10\Samples\Northwind.mdb;Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False")
Dim da As New OleDb.OleDbDataAdapter("select * from orders", conn)
Dim ds As New DataSet
da.Fill(ds)

After filling the dataset, fill the contents to any source like listbox,datagrid.

For datagrid,
datagrid1.datasource=ds

Here i have used the existing Northwind database.Replace with your own database.

Hope you found this useful

Regards

Exelio

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.