Table of Contents

Class SqlDataConnector

Namespace
Ranorex.Core.Data
Assembly
Ranorex.Core.dll

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

node XmlNode

An 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

name string

The name of the source.

connectionString string

The connection string to the database.

query string

The SQL query.

dialogDataSource string

The used database type.

provider string

The 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

string

Methods

GetFactory(string)

Gets a factory object for the named data provider.

public static DbProviderFactory GetFactory(string name)

Parameters

name string

The 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

node XmlNode

The 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

columns ColumnCollection

The loaded columns.

rows RowCollection

The 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

columns ColumnCollection

The columns to store.

rows RowCollection

The 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.