0

hi every one
i'm writing a program in vb.net in visualstudio i want to know how can i update my database by using dataadapter dataset dataconnection and command builder can you give me an example thank you

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by M.Waqas Aslam
0

Which database are you using? What is the table you want to update? Be specific.

0

hi
i'm going to make relation between my program a windows application and an access database i have a form with two text boxes buttons for update, new record and delete of records in my database

0

hello
try something like this.

dim con as new sqlconnection("connection string")
dim cmd as new sqlcommand
con.open()
cmd.connection = con 
cmd.commandtext = "update table1 set col1=@col1,col2=@col2,col3=@col3,col4=@col4 where recid = @recid"
cmd.paramerter.addwithvalues("@col1",txt1.text)
cmd.paramerter.addwithvalues("@col2",txt2.text)
cmd.paramerter.addwithvalues("@col3",txt3.text)
cmd.paramerter.addwithvalues("@col4",txt4.text)
cmd.paramerter.addwithvalues("@recid",txtRecId.text)
cmd.ExecutenonQuery()
con.close()

hope this will help you .

Regards

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.