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:
01376065
Vues:
14
>>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.

Thanks Paul. I got it using Naomi's suggestion.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform