|
-
Sep 22nd, 2004, 03:18 AM
#1
Thread Starter
Junior Member
How do I....
How do I display the data I retrive from a microsoft access database into a textbox in VB.NET?
-
Sep 22nd, 2004, 04:07 AM
#2
Fanatic Member
something like this
VB Code:
Dim cn As New OleDbConnection()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=d:/northwind.mdb"
cn.Open()
Dim cm As New OleDbCommand("select companyname from customers where customerid='alfki'", cn)
TextBox1.Text = CType(cm.ExecuteScalar, String)
cn.Close()
End Sub
-
Sep 22nd, 2004, 08:29 AM
#3
Thread Starter
Junior Member
Thanks a lot. I tried seatching on the net but a lot of example are meant for web based development, not desktop application
-
Sep 22nd, 2004, 10:34 AM
#4
PowerPoster
Originally posted by Buaya_hunter
Thanks a lot. I tried seatching on the net but a lot of example are meant for web based development, not desktop application
Did it work?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Sep 22nd, 2004, 07:44 PM
#5
Thread Starter
Junior Member
It works very well for my purpose
-
Sep 22nd, 2004, 07:58 PM
#6
PowerPoster
Hi,
The reason why I asked was that I had to use
Dim cn As New Oledb.OleDbConnection()
Dim cm As New Oledb.OledbCommand
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Sep 22nd, 2004, 08:00 PM
#7
Fanatic Member
imports system.data.oledb
-
Sep 22nd, 2004, 08:10 PM
#8
PowerPoster
Originally posted by brown monkey
imports system.data.oledb
Thank you
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|