| | |
retrieve data by VB.Net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2006
Posts: 22
Reputation:
Solved Threads: 0
I have a solution to ur problem. Mail ur problem at coolamit0072003@hotmail.com and I'll reply with solution.
•
•
Join Date: Aug 2006
Posts: 57
Reputation:
Solved Threads: 0
hi,
Here is the code to connect to the database in Ms Access.
Connection string for MS Access via OLE DB:
Dim connection As OleDbConnection
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NorthWind.mdb;User Id=;Password=;")
connection.Open();
After connecting to the database
dim da as new oledb.oledbdataadapter("select * from employees",connection)
dim ds as new dataset
da.fill(ds)
Now u can set the datas to the checked listbox.but u can assign only one column to it.
For eg
In checkedlistbox, u have a property items.
for i=0 to ds.tables(0).rows.count-1
Checkbox1.Items.Add(ds.tables(0).rows(i)(0)
next i
This will add all the rows with the first column values
Hope this helps
Regards
Exelio
Here is the code to connect to the database in Ms Access.
Connection string for MS Access via OLE DB:
Dim connection As OleDbConnection
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NorthWind.mdb;User Id=;Password=;")
connection.Open();
After connecting to the database
dim da as new oledb.oledbdataadapter("select * from employees",connection)
dim ds as new dataset
da.fill(ds)
Now u can set the datas to the checked listbox.but u can assign only one column to it.
For eg
In checkedlistbox, u have a property items.
for i=0 to ds.tables(0).rows.count-1
Checkbox1.Items.Add(ds.tables(0).rows(i)(0)
next i
This will add all the rows with the first column values
Hope this helps
Regards
Exelio
![]() |
Similar Threads
- retrieve data from database into jsp(urgent)!!! (Oracle)
- how to store and retrieve data from cookies (ASP.NET)
- VB.Net: Problem Retrieve data from ListView (VB.NET)
- How to retrieve data from a dynamically generated radio button (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Deleting from Random Access File?
- Next Thread: Issues with DLLs
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary bing box button buttons click code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists file-dialog firewall folder google hardcopy image images isnumericfuntioncall login math memory mobile module ms msaccess mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog serial sqldatbase storedprocedure string temp text textbox timer toolbox updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





