A connection string is a string which is used to gain access to different data sources from a VB .Net or a C# .Net application. The data sources can be MS SQL Server, MS Access or SQL Server on remote server.
A connection string is made of many parts and one of them is the Provider. A provider allows us to specify the driver which can access the datasource in binary form. With the provider, we can setup a connection from an application and gain access to the datasource. In a connection string, we specify the appropriate provider depending on the datasource we wish to access. Note that when we need to connect to sql server we need not mention the provider in the connection string. You will see this, when we write the connection string for connecting a VB. Net application or C# application to an Sql Server database.
In the above example, Data Source is the machine name of the computer that is running sql server, in this case SYS2. \u2018Integrated security\u2019 indicates that current user's windows credentials (username and password) are being used to access and connect to sql server. The possible values for Integrated Security
In the above code, "database" refers to the name of the specific database that we would like to access. A Connection string also has other properties like connection pooling, length of timeout period and security options. Note that we can use and implement a connection string without using these other properties. Connection string is a property of the connection object. While using the connection
MyConn.ConnectionString = \u201cProvider = Microsoft.Jet.OLEDB.4.0; Data \u201c & _
\u201cSource = C : \ data \ northwind.mdb ; User Id = guest; \u201c & _
\u201cPassword = isw3083\u201d
Giving away username and password in the connection string code is vulnerable to phishing. An option to overcome this problem is by using the Windows integrated security. Consider the following connection
In the above code, we assign the IP address of the server to the \u2018Data Source\u2019, assign the name of the
database, assign the username and the password. The above code is used to connect to a database
hosted on a web server.
The Connection object establishes a connection to the database. Two of the most common Connection objects used are OleDbConnection and SqlConnection. Both the SqlConnection and OleDbConnection are namespaces and are inherited from the IdbConnection object. The commonly used property of the Connection object is the Connection string property.
Now bringing you back...
Does that email address look wrong? Try again with a different email.