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

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

public SqlClient(
	string 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)

The following example creates an instance of the SqlClient class with the parameter name in the configuration file that contains the connection string to the SQL Server.

using (SqlClient client = new SqlClient("MyConnectionString"))
  // ...

Here's the file web.config:

      connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=example;Trusted_Connection=True;" 
See Also