A sql adapter is based on a sql select command. That sql statement you're passing in when you create the adapter is being used to create the command behind the scenes. So you've basically got a couple of choices:-I ask about sqlcommand parameters before, and this time about how to add parameters to sqldataadapter
1. You can create the adapter as you are but pass in a select statement containg @parm rather than string concatenation. Then you can ad parameter to the underlying commance by using Adapter.SelectCommand.Parameters.AddWithValue (or similar)
2. You can create the adapter without passing in a select statement, create the sql command explicitely complete with parameters (as you've done previously in this thread) and then set it as the SelectCommand of the adapter.
Basically, your adapter has a command, that command has parameters. Does that clarify it?




Reply With Quote
