944,029 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 26010
  • VB.NET RSS
May 3rd, 2006
0

retrieve data by VB.Net

Expand Post »
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 :-|
Reputation Points: 10
Solved Threads: 0
Light Poster
DATABASE is offline Offline
32 posts
since May 2006
Aug 15th, 2006
0

Re: retrieve data by VB.Net

I have a solution to ur problem. Mail ur problem at coolamit0072003@hotmail.com and I'll reply with solution.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Amit007 is offline Offline
22 posts
since Aug 2006
Aug 16th, 2006
1

Re: retrieve data by VB.Net

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
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006
Aug 4th, 2010
0
Re: retrieve data by VB.Net
searching data by one character
Reputation Points: 10
Solved Threads: 0
Newbie Poster
durgeshmali1987 is offline Offline
3 posts
since Aug 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Code Reuse
Next Thread in VB.NET Forum Timeline: download multiple files using vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC