Executes a select statement or stored procedure that returns a record set. Uses the CommandConfig argument to encapsulate the
command text and any parameter values.
| C# | Visual Basic |
public void ExecuteQuery( CommandConfig CmdConfig )
Public Sub ExecuteQuery ( _ CmdConfig As CommandConfig _ )
- CmdConfig (CommandConfig)
-
The SQL statement and parameters
DbNetData Data = new DbNetData( ConfigurationSettings.AppSettings[ "nwind" ] ); Data.Open(); CommandConfig CmdConfig = new CommandConfig("select * products"); CmdConfig.Params["discontinued"] = 1; Data.ExecuteQuery(CmdConfig) DiscontinuedProductsGridView.DataSource = Data.Reader; DiscontinuedProductsGridView.DataBind(); Data.Close();