Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IDbDataParameters
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01138264
Message ID:
01138271
Views:
10
Linda
>
>
>            // Query using parameters
>            //IDbDataParameter param1 = this.CreateParameter("@Category", category);
>            //IDbDataParameter param2 = this.CreateParameter("@Did", dId);
>            //this.GetDataSet("SELECT * FROM Personnel WHERE Category = " + param1 + " AND Diocese = " + param2);


You don't add the parameter to the SQL like that. Try this:

<pre>
this.GetDataSet("SELECT * FROM Personnel WHERE Category = @Category AND Diocese = @Did", param1, param1);
-Paul

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

Click here to load this message in the networking platform