Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE Syntax
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
01376029
Message ID:
01376045
Views:
11
>Can some one give me the correct syntax for the third line in
>sql2 = "UPDATE TRPSites SET "
>sql2 += "[AWS]= '" + oReader("AWS") + "' "
>sql2 += "[FlexSched]= '" + oReader("FlexSched").ToString + "' "
>sql2 += "WHERE keyID = " + GridView1.DataKeys(i).Value.ToString()
>Where FlexSched is a boolean field?
>Thanks


If FlexSched is boolean you don't need quotes around it. Also, you're missing the ending parenthesis on ToString. The other issue is that (assuming this is SQL server), calling ToString() on a boolean turns it into "True" or "False" (without the quotes), but SQL is expecting a 1 or 0.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform