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.
Namespace:
DbNetLink.DataAssembly: DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public void ExecuteQuery( CommandConfig CmdConfig ) |
| Visual Basic (Declaration) |
|---|
Public Sub ExecuteQuery ( _ CmdConfig As CommandConfig _ ) |
| Visual C++ |
|---|
public: void ExecuteQuery( CommandConfig^ CmdConfig ) |
Parameters
- CmdConfig
- Type: DbNetLink.Data..::.CommandConfig
The SQL statement and parameters
Examples
DbNetData Db = new DbNetData( ConfigurationManager.ConnectionStrings["nwind"] ); Db.Open(); CommandConfig CmdConfig = new CommandConfig("select * products"); CmdConfig.Params["discontinued"] = 1; Db.ExecuteQuery(CmdConfig) DiscontinuedProductsGridView.DataSource = Db.Reader; DiscontinuedProductsGridView.DataBind(); Db.Close();