add Info From TextBox to DB Access

aissa

New member
Joined
Jan 15, 2010
Messages
1
Programming Experience
Beginner
Hi !
I am beginer in devlopment and i am new in this forum!
First ! I learn How to info from DB Access to TextBox !
This is the methode :
After the connection in public class Form 1

Dim myconn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & Application.StartupPath & "\MyData.mdb")

in load_Form 1 :

myconn.Open()
Dim Mycomm As OleDbCommand = myconn.CreateCommand()
Mycomm.CommandText = "select Name, City, Mobile FROM Table1"

Dim myRead As OleDbDataReader = Mycomm.ExecuteReader()
If myRead.Read() Then
TextBox1.Text = myRead.GetString(0)
TextBox2.Text = myRead.GetString(2)
TextBox3.Text = myRead.GetString(1)
End If
myconn.Close()

i would like doing the addition from TextBox to DB Access !
with the some methode !
and thnaks ! good bye !
 
Last edited:
Back
Top