Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optional query parameter
Message
 
To
19/10/2007 14:03:28
Xiaodong Yan
Better Database Solutions
Spring, Texas, United States
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01262249
Message ID:
01262267
Views:
6
>Hi,
>
>Have an SqlDataAdapter to query a table. To pull records with certain agentid, "Where AgentID=@AgentID" worked just fine.
>
>How can I use the same query to pull either records for a certain agentid, or ALL agent records? i.e., optional parameter?
>
>Thanks,
>Xiaodong


something like..

'where @AgentID is Null or AgentID=@AgentID'

and then pass NULL to @AgentID.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform