retrieve data by VB.Net

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 32
Reputation: DATABASE is an unknown quantity at this point 
Solved Threads: 0
DATABASE DATABASE is offline Offline
Light Poster

retrieve data by VB.Net

 
0
  #1
May 3rd, 2006
hi
I have some questions in VB.Net


1- how can I retrieve data by VB.Net from database using MS Access database?
2- can I retrieve data from a database and list them in a CheckedListBox?


thanx

Please help me :-|
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 22
Reputation: Amit007 is an unknown quantity at this point 
Solved Threads: 0
Amit007 Amit007 is offline Offline
Newbie Poster

Re: retrieve data by VB.Net

 
0
  #2
Aug 15th, 2006
I have a solution to ur problem. Mail ur problem at coolamit0072003@hotmail.com and I'll reply with solution.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: retrieve data by VB.Net

 
0
  #3
Aug 16th, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC