Class SqlDataConnector
Provides access to data stored in SQL (Structured Query Language) databases.
public class SqlDataConnector : DataConnector, IDisposable
- Inheritance
-
SqlDataConnector
- Implements
- Inherited Members
Constructors
SqlDataConnector(XmlNode)
Initializes a new instance of the SqlDataConnector class.
public SqlDataConnector(XmlNode node)
Parameters
nodeXmlNodeAn XML node containing the definition of the source.
SqlDataConnector(string, string, string, string, string)
Initializes a new instance of the SqlDataConnector class.
public SqlDataConnector(string name, string connectionString, string query, string dialogDataSource, string provider)
Parameters
namestringThe name of the source.
connectionStringstringThe connection string to the database.
querystringThe SQL query.
dialogDataSourcestringThe used database type.
providerstringThe name of the underlying data provider provider used for the SQL connection.
Properties
ConnectionString
Gets or sets the connection string to the database.
public string ConnectionString { get; set; }
Property Value
- string
The database connection string.
DialogDataSource
Gets or sets the type of database used.
public string DialogDataSource { get; set; }
Property Value
- string
The type of database used.
Provider
Gets or sets the name of the underlying data provider provider used for the SQL connection.
public string Provider { get; set; }
Property Value
- string
The name of the underlying data provider provider used for the SQL connection.
Query
Gets or sets the SQL query selecting the data from the database.
public string Query { get; set; }
Property Value
- string
The SQL query.
XmlIdentifier
Gets the unique identifier for serialization and deserialization purposes as well as factory creation.
public override string XmlIdentifier { get; }
Property Value
Methods
GetFactory(string)
Gets a factory object for the named data provider.
public static DbProviderFactory GetFactory(string name)
Parameters
namestringThe name of the data provider.
Returns
- DbProviderFactory
A factory that can be used to create data providers of the specified name.
GetXMLNodeDerived(XmlNode)
Add DataSource specific information from derived classes to the node
protected override void GetXMLNodeDerived(XmlNode node)
Parameters
nodeXmlNodeThe node to which information should be added.
LoadDataImpl(out ColumnCollection, out RowCollection)
Loads the data from the source using the provided ConnectionString and SQL Query.
protected override void LoadDataImpl(out ColumnCollection columns, out RowCollection rows)
Parameters
columnsColumnCollectionThe loaded columns.
rowsRowCollectionThe loaded rows.
Exceptions
- DataException
If loading the data fails, e.g. if the connection to the database cannot be established.
StoreDataImpl(ColumnCollection, RowCollection)
Stores the data to the data source. Currently not supported.
protected override void StoreDataImpl(ColumnCollection columns, RowCollection rows)
Parameters
columnsColumnCollectionThe columns to store.
rowsRowCollectionThe rows to store.
Remarks
This functionality is currently not supported by this data source.
Exceptions
- NotSupportedException
Storing data to SQL databases is currently not supported.