Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding OLEDB Crashes
Message
De
23/08/2010 16:45:51
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Avoiding OLEDB Crashes
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01478041
Message ID:
01478041
Vues:
106
I'm doing an application that reads and updates some VFP tables along with SQL Server tables.

For a variety of reason, I'm not using data binding, but instead I'm constructing and executing commands as follows:

string strupdatestring = "Update somast01 SET ponum = ' '" + textBoxPonum.Text + “’"

During testing, I mistakenly typed a ""' in the textBoxPonum field and when the program ran the command above (ExecuteNonQuery), the provider dutifully returned a message that the command contained junk.

Is there any shortcut here or do I have to check every field for things like quote signs?

Besides quote signs and apostrophes, what else can bring it down?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform