Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optional query parameter
Message
 
À
19/10/2007 14:03:28
Xiaodong Yan
Better Database Solutions
Spring, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01262249
Message ID:
01262267
Vues:
7
>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!
____________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform