Results 1 to 3 of 3

Thread: How to update the record with sql update

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    15

    How to update the record with sql update

    rs("Yazaradi") = txtYa.Text
    rs("Kitapadi") = txtEa.Text
    rs("Yayinevi") = txtYe.Text
    rs("ISBN") = txtIsbn.Text
    rs.Update
    As I use this code to update, it updates the record but leaves the old record behind. Actually it doesn't work properly.

    Ok, I would like to know how to use the sql update in the code above to update the record properly. Could somebody give an example?

    Thank you

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: How to update the record with sql update

    Are your controls binded to a data control? You may need to refresh the data control after your update to reflect the changes or try...

    VB Code:
    1. rs("Yazaradi") = txtYa.Text
    2. rs("Kitapadi") = txtEa.Text
    3. rs("Yayinevi") = txtYe.Text
    4. rs("ISBN") = txtIsbn.Text
    5. rs.Update
    6. [B]rs.Requery[/B]
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: How to update the record with sql update

    That's not really a SQL update. That would be something like:
    strSQL = "UPDATE tblBook SET Yazaradi = '" & txtYa & "', Kitapadi = '" & txtEa & "', 'etc
    then execute the SQL.
    Tengo mas preguntas que contestas

Posting Permissions

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



Click Here to Expand Forum to Full Width