SqlClient Constructor (String, Int32)Nemiro.Data.dll
Initializes a new instance of the SqlClient class.

Namespace: Nemiro.Data.Sql
Assembly: Nemiro.Data (in Nemiro.Data.dll) Version: 2.11.4.126 (2.11.4.126)
Syntax

public SqlClient(
	string connectionString,
	int cacheDuration
)

Parameters

connectionString
Type: System String
Connection string. For example: user id=;password=;data source=(local);initial catalog= Default value: LocalSqlServer (key name of the connection string in the.config file)
cacheDuration
Type: System Int32
Duration caching the query results (in seconds). Minus one - without caching. Zero - use the value of the configuration file parameter NeData:Sql:CacheDuration.
Examples

The following example creates an instance of the SqlClient class with specifying the connection string and duration caching the query results.

using (SqlClient client = new SqlClient(@"Data Source=.\SQLEXPRESS;Initial Catalog=example;Trusted_Connection=True;", 300))
{
  // ...
}
See Also