|
-
Oct 24th, 2006, 03:17 AM
#1
Thread Starter
Addicted Member
[RESOLVED] update staement
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 "
Using VB.NET 2003/.NET 1.1
If you found a post useful then please Rate it!
Please mark you thread resolved using the Thread Tools above
-
Oct 24th, 2006, 03:19 AM
#2
Re: update staement
I suggest that you read the SQL tutorial in my signature.
-
Oct 24th, 2006, 03:23 AM
#3
Hyperactive Member
Re: update staement
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
-
Oct 24th, 2006, 03:35 AM
#4
Thread Starter
Addicted Member
Re: update staement
all the fields are text (string) except date
Using VB.NET 2003/.NET 1.1
If you found a post useful then please Rate it!
Please mark you thread resolved using the Thread Tools above
-
Oct 24th, 2006, 03:40 AM
#5
Hyperactive Member
Re: update staement
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 & "'"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|