Returns a DataTable for the supplied QueryCommandConfig
Namespace:
DbNetLink.DataAssembly: DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public DataTable GetDataTable( QueryCommandConfig CmdConfig ) |
| Visual Basic (Declaration) |
|---|
Public Function GetDataTable ( _ CmdConfig As QueryCommandConfig _ ) As DataTable |
| Visual C++ |
|---|
public: DataTable^ GetDataTable( QueryCommandConfig^ CmdConfig ) |
Parameters
- CmdConfig
- Type: DbNetLink.Data..::.QueryCommandConfig
Combined parameterised sql statement/procedure and parameter values
Return Value
A DataTable
Examples
DbNetData Db = new DbNetData( ConfigurationManager.ConnectionStrings["nwind"] ); Db.Open(); Product.DataTextField="ProductName"; Product.DataValueField="ProductID"; QueryCommandConfig CmdConfig = new QueryCommandConfig("select * from products where categoryid = @categoryid"); CmdConfig.Params["categoryid"] = CategoryID.Value; Product.DataSource = Db.GetDataTable(CmdConfig); Product.DataBind() Db.Close();