MobileForms Toolkit Documentation

SmartGrid.DbConnector Property

Gets the DataConnector which is defaultly used to load the data.

public DataConnector DbConnector {get;}

Property Value

The DataConnector which is defaultly used to load the data.

Remarks

By default, the DbConnector is used to connect to SqlServerCe database. If command text or connection string is set, new SqlCeCommand and SqlCeConnection, or the Command property is accessed, the command is created within the connector. If you want to use other type of access (e.g. Sql direct), you must create the object with the IDbCommand interface (SqlCommand) with the Connection set.

DbConnector exposes property Command, which can be used to manipulate with the command. It is exposed only as IDbCommand, so you have to convert the type to used command (e.g. SqlCeCommand) or use just the IDbCommand properties and methods. This is suitable for e.g. setting existing open connection to command, or manipulating the parameters of the command (see example).

Example

This example shows the advanced usage of the DbConnector:

See Also

SmartGrid Class | Resco.Controls.SmartGrid Namespace | DataConnector