Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE Syntax
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
01376029
Message ID:
01376045
Vues:
17
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform