Categories
- Beauty & Style
- Computers & Tech
- Education & School
- Entertainment
- Environmental Issues
- Food & Dining
- FunAdvice Community
- Gaming & Games
- General Knowledge
- Health
- Home & Garden
- Jobs & Money
- Kids
- Love & Relationships
- Music
- Nutrition & Fitness
- Parents & Family
- Pets & Animals
- Politics
- Religion & Spirituality
- Science
- Shopping
- Sports
- Travel
- Writing & Literature
Answer this Question: "retriving data from msaccess database"
Our members said the answers on this page also answer the following questions:
Dim con as new oledbconnection("provider=microsoft.jet.oledb.4.0;data s?, C oledbdataadapter select where?, _con.open( c# msaccess?, Cmd = new oledbcommand syntax ms access?, Textbox1.databindings oledbdatareader?, Me close ms access?, Textbox5.text = ("dr" & (5))
Popular questions related to retriving data from msaccess database
- Ipod touch is in recovery mode-what do I do??
- How do I get my AOL Favorites back?
- How can I get my password for Photobucket?
- LG KS360 Data Transfer
- Facebook: you can check in, but you can't check out.
- Uploading songs from my itunes to LG KS360
- FIDO Blackberry Pearl 8100
- Cricket mms retrival
- My computer needs fixed.. help..:)
- Making editable PDF files so they can be saved
- Saving Stickies (mac) to a USB
- Can I find again datas deleted from internet history ?
- I attached my I pod to pc and I tune sync. removed my data from I pod
- How much data can a floppy disk hold?
- 30 MB Data means?
- Why does Guitar Hero 3 crash the computer?
Share this question
Copy and paste this code:It will display on your blog or site like this:
Retriving data from msaccess database
 



Retriving data from msaccess database
by selecting the employee number in the combobox and click the button1 the details of the relevant employee is to viewed.
my prblm is that giving any employee number the same one is displaying
wt fault with my code!!!
help me
Imports...
System.Data
Imports System.Data.OleDb
Public Class Form2
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim adp As OleDbDataAdapter
Dim ds As New DataSet
' Dim str As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\employee.mdb)
adp = New OleDbDataAdapter(select * from table1, con)
adp.Fill(ds)
Dim I As Integer
For I = 0 To ds.Tables(0).Rows.Count - 1
ComboBox1.Items.Add(ds.Tables(0).Rows(I).Item(0))
Next I
con.Close()
' cmd = New OleDbCommand(select * from table1 where eno= index , con)
'dr = cmd.ExecuteReader()
' If (dr.Read()) Then
' End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con = New OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\employee.mdb)
con.Open()
cmd = New OleDbCommand(select * from table1, con)
dr = cmd.ExecuteReader
While dr.Read()
TextBox1.Text = dr(1)
TextBox2.Text = dr(2)
TextBox3.Text = dr(3)
TextBox4.Text = dr(4)
TextBox5.Text = dr(5)
TextBox6.Text = dr(6)
TextBox7.Text = dr(7)
TextBox8.Text = dr(8)
End While
Catch
End Try
dr.Close()
con.Close()
'cmd = New OleDbCommand(update table1 set firstname=' TextBox1.Text ', lastname=' TextBox2.Text ',paddress=' TextBox3.Text ', phoneno=' TextBox4.Text ',pincode=' TextBox7.Text ',city=' TextBox5.Text ',state=' TextBox6.Text ',age= TextBox8.Text where no= ComboBox1.SelectedItem , con)
'cmd.ExecuteScalar()
'MessageBox.Show(updated)
'con.Close()
' con.Close()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
con.Open()
adp = New OleDbDataAdapter(select * from table1 where no= ComboBox1.SelectedItem , con)
ds.Tables.Clear()
adp.Fill(ds)
display()
' cl()
con.Close()
End Sub
Sub display()
TextBox1.DataBindings.Add(text, ds.Tables(0), firstname)
TextBox2.DataBindings.Add(text, ds.Tables(0), lastname)
TextBox3.DataBindings.Add(text, ds.Tables(0), paddress)
TextBox4.DataBindings.Add(text, ds.Tables(0), phoneno)
TextBox5.DataBindings.Add(text, ds.Tables(0), pincode)
TextBox6.DataBindings.Add(text, ds.Tables(0), city)
TextBox7.DataBindings.Add(text, ds.Tables(0), state)
TextBox8.DataBindings.Add(text, ds.Tables(0), age)
End Sub
'Sub cl()
' TextBox1.DataBindings.Clear()
' TextBox2.DataBindings.Clear()
' TextBox3.DataBindings.Clear()
' TextBox4.DataBindings.Clear()
' TextBox5.DataBindings.Clear()
' TextBox6.DataBindings.Clear()
'TextBox7.DataBindings.Clear()
' TextBox8.DataBindings.Clear()
' End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Form1.Show()
Me.Close()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Form3.Show()
Me.Close()
End Sub
End Class