Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Posts
    45

    Unanswered: update dataadapter with text box value

    hi

    this is probably a piece of pie to fix but i be having some problems......

    i have this peice of code to update the sql dataapadapter

    Dstest1.Tables("test").Rows(0)("hello") = Me.textboxhello.Text
    SqlDataAdapter1.Update(Dstest1, "test")

    this does not work, it does work however if i replace the Me.textboxhello.Text
    with a value in quotation marks or with another text box not linked to that feild in the table... it does not work with the relevant text box!!!!!!!!

    thanks for all your help

    cq
    Sent By Royal Mail

  2. #2
    Join Date
    Aug 2002
    Posts
    45
    no worrys

    this takes care of it...

    Try
    Me.BindingContext(Me.Dstest1, "test").EndCurrentEdit()
    Dstest1.Tables("test").Rows(0)("test") = Me.testbox.Text
    Dstest1.Tables("test").Rows(0)("hello") = Me.textboxhello.Text
    SqlDataAdapter1.Update(Dstest1, "test")
    Dstest1.AcceptChanges()
    Catch ex As Exception
    MessageBox.Show(ex.ToString)
    Dstest1.RejectChanges()
    End Try
    Sent By Royal Mail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •