Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting to VFP Data in ASP.NET
Message
De
03/01/2006 17:15:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01072118
Message ID:
01082917
Vues:
30
Tim,

>Cetin, isn't ADO for xml data? I have not delved into that before.<

PMFJI ... no, ADO.NET isn't only for XML data. ADO.NET refers to anything you do with data ... that means the data store (DataSets, DataTables, etc), plus the data access. So, yes, you've used ADO.NET when you access SQL Server, VFP or any other database.

You really should look into parameterizing your database calls, as Cetin has tried to explain. But, since you want an answer using your method of building a string, it would simply be something like this:

Your way:
vDataSource2.SelectCommand = "SELECT title, type_dish FROM dish WHERE title LIKE '%'" + TextBox1.Text + "'%')"
Cetin's way:
vDataSource2.SelectCommand = String.Format("select * from myTable where title like '%{0}%'", TextBox1.Text)
Both methods will give you the same SelectCommand string.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform