>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!
____________________________________