Friday 17 May 2013

What is ADO.NET Connection String and How to Make It?

ConnectionStringExplanation
ADO.NET is the fundamental technology using which .NET applications can extract, process and store data to and from different types of databases. Both to get data from DB or save data to it we need to first establish a connection to that database. A ConnectionString is a property in every database client class of .NET that allows us to provide various details about the target and nature of connection we want and also the authentication details. A ConnectionString is a normal string with different keys and values mentioned in it separated by semicolons. Here’s an example:
client.ConnectionString = “Initial Catalog=MyDatabase;Data Source=MyServer;Integrated Security=SSPI;User ID=Me;Password=MyPassword;”;
Here,
Initial Catalog is the database we are connecting to.
Data Source is the server on which database is running.
Integrated Security tells if we want a secure connection or not. Possible values: true (Windows authentication used), false, yes, no and SSPI (Security Support Provider Interface).
User ID is the database user ID for authenticating the connection.
Password
is obviously the password for the User ID entered.
Of course this string could at first be assigned to a string variable and then entered into the ConnectionString property.

0 comments:

Post a Comment

All Articles © Asit. No Copying. Powered by Blogger.
 
Copyright © . The Tech Veda - Posts · Comments
Markup Powered by Bluefish Editor 2.2