SQL Relay ADO.NET API

- Main Page
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Properties | List of all members
SQLRClient.SQLRelayConnection Class Reference

Inherits IDbConnection.

## Public Member Functions
| SQLRelayConnection ()
| SQLRelayConnection (String connectstring)
void | Open ()
void | Close ()
SQLRelayTransaction | BeginTransaction ()
SQLRelayTransaction | BeginTransaction (IsolationLevel isolationlevel)
void | ChangeDatabase (String db)
IDbCommand | CreateCommand ()

## Properties
String | ConnectionString`[get, set]`
Int32 | ConnectionTimeout`[get]`
String | Database`[get]`
ConnectionState | State`[get]`
Boolean | Debug`[get, set]`

## Constructor & Destructor Documentation

SQLRClient.SQLRelayConnection.SQLRelayConnection | ( |  | ) |

Initializes a new instance of the SQLRelayConnection class.

SQLRClient.SQLRelayConnection.SQLRelayConnection | ( | String | connectstring | ) |

Initializes a new instance of the SQLRelayConnection class when given a string that contains the connection string. The connection string must be of the following format: "variable=value;variable=value;" Valid variables include:

Data Source - The SQL Relay server to connect to. This may be specified as host:port, host:port:socket or just socket. If host, port and socket are all three specified, then a connection will first be attempted to the local socket and then to the host/port.

User ID - The username to use when logging into SQL Relay.

Password - The password to use when logging into SQL Relay.

Retry Time - If a connection fails, it will be retried on this interval (in seconds).

Tries - If a connection fails, it will be retried this many times.

Initial Catalog - The database/schema to switch to after logging in. Optional.

Debug - If this is set to true then debug is enabled.

## Member Function Documentation

SQLRelayTransaction SQLRClient.SQLRelayConnection.BeginTransaction | ( |  | ) |

Starts a database transaction.

SQLRelayTransaction SQLRClient.SQLRelayConnection.BeginTransaction | ( | IsolationLevel | isolationlevel | ) |

Starts a database transaction with the specified isolation level. This method is implemented because it is required by the interface but SQL Relay doesn't currently support setting the isolation level here.

void SQLRClient.SQLRelayConnection.ChangeDatabase | ( | String | db | ) |

Changes the current database for an open SQLRelayConnection.

void SQLRClient.SQLRelayConnection.Close | ( |  | ) |

Closes the connection to the database. This is the preferred method of closing any open connection.

IDbCommand SQLRClient.SQLRelayConnection.CreateCommand | ( |  | ) |

Creates and returns a SQLRelayCommand object associated with the SQLRelayConnection.

void SQLRClient.SQLRelayConnection.Open | ( |  | ) |

Opens a database connection with the property settings specified by the ConnectionString.

## Property Documentation

String SQLRClient.SQLRelayConnection.ConnectionString
| get set

Gets or set the string used to open a connection to SQL Relay. See the constructor for a descripton of the connection string.

Int32 SQLRClient.SQLRelayConnection.ConnectionTimeout
| get

Gets Retry Time * Tries. See the constructor for a descripton of Retry Time and Tries.

String SQLRClient.SQLRelayConnection.Database
| get

Gets the Initial Catalog, if one was set. See the constructor for a descripton of the Initial Catalog.

Boolean SQLRClient.SQLRelayConnection.Debug
| get set

Gets or sets whether debug is enabled.

ConnectionState SQLRClient.SQLRelayConnection.State
| get

Indicates the state of the SQLRelayConnection when the most recent network operation was performed on the connection.