0

hi ive been trying to insert specific data into a certain textbox from an access table, ive managed to pull the information from one field onto a listbox but i cant grab specific data and load it onto a textbox: here is the code, if anyone can help please that would be great...

    Dim cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\student.mdb;User Id=admin;Password=;"
    Dim dataBaseConnection As New OleDbConnection(cnString)
    Dim dataBaseCommand As New OleDbCommand("SELECT Name FROM Student WHERE Student Number = """ & txtSearch.Text & """", dataBaseConnection)
    Dim dataReader As OleDbDataReader
    Try
        dataBaseConnection.Open()
        dataReader = dataBaseCommand.ExecuteReader()
        dataSet.Tables.Add(dataTable)
        dataSet.Tables(0).Load(dataReader)


        'Manual Binding - ultimate control
        Dim i As Integer

        For i = 0 To dataSet.Tables(0).Rows.Count - 1
            txtStuName.Text.Contains(dataSet.Tables(0).Rows(i).Item("Name").ToString())
        Next
    Catch ex As Exception
    End Try

Edited by pyTony: fixed formatting

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by binoj_daniel
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.