Title: showing data in textboxes using access
Tags: vb.net;ms-access
Question: ave a table namely studentsrecords which consists of IDNumber,Firstname,Lastname,MiddleName and Course
I will login the system with my IDNumber as my username and MiddleName to be my password
it will direct me to the form that has 3 textboxes.: txtIDNumber,txtLastName and txtCourse
all i want is when i log in the system with my IDNumber.,.,it will load data in textboxes the IDNumber which i use to log in, The lastname of the students IDNumber and the Course of the student,.,using IDNumber
im only a newbie here..
con.Open()
Dim str As String = "SELECT * FROM studentsrecords"
Dim cmd As New OleDbCommand(str, con)
da = New OleDbDataAdapter(cmd)
ds = New DataSet
con.Open()
da.Fill(ds, "evaluation")
con.Close()
txtflash.DataBindings.Add("Text", ds.Tables("evaluation"), "LastName")
txtcourse.DataBindings.Add("Text", ds.Tables("evaluation"), "Course")


Here is another answer: 1st You have to send IdNumber to MainForm from login form and set your query as,
Dim str As String = "SELECT * FROM studentsrecords where IDNumber=[Id Number from Login Form] "
Then,
Please try like this,
txtflash.DataBindings.Add(New Binding("Text", ds.Tables("evaluation"), "LastName"))
txtcourse.DataBindings.Add(New Binding("Text", ds.Tables("evaluation"), "Course"))
Comment for this answer: No value given for one or more required parameters.
da.Fill(ds, "evaluation")
Comment for this answer: In his example above, where he wrote "[Id Number from Login Form]", you need to put the criteria to get the single record from the StudentRecords table.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:10/11/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<vb.net><ms-access>', 'Title': 'showing data in textboxes using access', 'ViewCount': 446, 'id': 19323042, 'user_AboutMe': None, 'user_AccountId': 3315622.0, 'user_DisplayName': 'Vincent Reguindin', 'user_Reputation': 7.0, 'user_Views': 61.0, 'user_id': 2788072.0}}