Help DataBinding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hathan
    New Member
    • Dec 2007
    • 10

    #1

    Help DataBinding

    Hi Everyone,
    as you can see below i have sent data from a Access database to text boxes. I have used DataBinding to do this the problem i have is that databinding is readonly and i want to write to it many times does anyone know of anythink else i can use instead


    Dim connStr As String = "Provider = Microsoft.Jet.O LEDB.4.0;" & _
    "Data Source = G2G.mdb"
    Dim squlStr As String = "SELECT * From Staff WHERE ((Staff_No=" & StaffnoTxt.Text & "))"
    Dim oleDbStaffAdapt er As New OleDb.OleDbData Adapter(squlStr , connStr)
    Dim oDataTable As New DataTable


    oleDbStaffAdapt er.Fill(oDataTa ble)
    FnameTxt.DataBi ndings.Add(New Binding("Text", oDataTable, "First_Name "))
    LastnameTxt.Dat aBindings.Add(N ew Binding("Text", oDataTable, "Surname"))
    NoTxt.DataBindi ngs.Add(New Binding("Text", oDataTable, "Tel_No"))
    PcodeTxt.DataBi ndings.Add(New Binding("Text", oDataTable, "Post_Code" ))
    DoornoTxt.DataB indings.Add(New Binding("Text", oDataTable, "House"))
Working...