开发者

problem to update a data in vb.net(for only one coulam in back end database)

开发者 https://www.devze.com 2023-03-24 06:31 出处:网络
friends i开发者_开发知识库 has small probelm.. VB.NET i have only one colum in back end database that is roll. ..

friends i开发者_开发知识库 has small probelm..

VB.NET i have only one colum in back end database that is roll. ..

Now i want to update a particular data ..

the data types is integer..

i has a data like 12 and i ant to update it 13 how can i do.. how can i do this My code is---

    dim s1 as integer=TextBox1.Text
  str = "UPDATE  Table1 SET roll=" & TextBox1.Text & "  WHERE roll= " & s1 & " "
        cmd = New SqlCommand(str, cn)
        cmd.ExecuteNonQuery()


you are updating it with it's own value, I think textbox1.text in the SQL should be the modified text field?

0

精彩评论

暂无评论...
验证码 换一张
取 消