can u plz give me the correct syntax of the update statement below
VB Code:
ins = "update [data] set [inv] = rs(inv),[add]=rs(add) , pkg=rs(pkg), box=rs(box),lno=textbox6,date=dtp1,lrno=textbox7 "
Printable View
can u plz give me the correct syntax of the update statement below
VB Code:
ins = "update [data] set [inv] = rs(inv),[add]=rs(add) , pkg=rs(pkg), box=rs(box),lno=textbox6,date=dtp1,lrno=textbox7 "
I suggest that you read the SQL tutorial in my signature.
Hi,
You are not building the string correctly
it should something like
VB Code:
update [data] set [inv] =" & rs(inv) & ",[add]=" & rs(add) & ", pkg=" & rs(pkg)& ", box=" & rs(box) & ",lno=" & textbox6.text & ",date=" & dtp1 & ",lrno=" & textbox7.text
I just not insert quotes because I do not know which fields are numeric and which ones are alphanumerics
But, I strongly do not recomend to do that use parameters, instead of that long statements (check tutorials for ADO.NET to know of it works) Yo can found some of them on my signature
Hope this helps
all the fields are text (string) except date
Then you need to put single quotes
update [data] set [inv] ='" & rs(inv) & "',[add]='" & rs(add) & "', pkg='" & rs(pkg)& "', box='" & rs(box) & "',lno='" & textbox6.text & "',date=" & dtp1 & ",lrno='" & textbox7.text & "'"