Helllo
I have a database acess (db) with column ID, Age, Sex, Name
And a windows form1 (vb.net) with textbox as ID and a button "search". A second form2 having textboxes as ID, Age,Sex. Name
When i enter ID no. with search buuton it should retrieve data from db to various textboxes in form2. i dont't know the code.
plese help
Satyam_1
0
Junior Poster
Recommended Answers
Jump to PostImports System.Data.OleDb Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Change Tablename,Access Full path,Password Dim CN As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source='" & "Access Full Path" & "';" & "Persist Security Info=False;" & "Jet OLEDB:Database Password=" & "your pass" & …
Jump to PostPut dr.close in here:
If dr.Read Then form2.ID.Text = dr("ID") form2.Age.Text = dr("Age") form2.Sex.Text = dr("Sex") form2.Name.Text = dr("Name") form2.show() dr.Close() Else MsgBox("No Such Account") End If Catch End Try CN.Close()
All 8 Replies
oussama_1
39
Posting Whiz in Training
Satyam_1
0
Junior Poster
oussama_1
39
Posting Whiz in Training
Satyam_1
0
Junior Poster
oussama_1
39
Posting Whiz in Training
Satyam_1
0
Junior Poster
oussama_1
39
Posting Whiz in Training
Satyam_1
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.