| | |
vb.net communication to ms acess database
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2006
Posts: 57
Reputation:
Solved Threads: 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
atabase Locking Mode=1;Jet OLEDB
atabase 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
ystem database=;Jet OLEDB
FP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB
on'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
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
atabase Locking Mode=1;Jet OLEDB
atabase 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
ystem database=;Jet OLEDB
FP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB
on'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
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- data base connection in vb.net (VB.NET)
- How do I store Unique Values to More than One Same Names in Database using VB.NET (VB.NET)
- VB.Net communicating with MySQL Database. (VB.NET)
- Saving information from .NET webcontol into access(database) (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Crystal report
- Next Thread: Quotation Confusion
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account array basic beginner bing browser button buttons center check code crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags google gridview hardcopy html images input insert intel internet mobile monitor net networking objects open output panel passingparameters pdf picturebox picturebox1 port position print printing problem save searchbox searchvb.net select serial settings shutdown soap sqlserver survey table tcp temperature text textbox timer timespan toolbox transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





