How to connect with different types of DataBase


Introduction

While developing Ado.Net Applicaions most of the errors comes because of the wrong format of Connection String used to connect the application with the DataBase. I am publishing some Connection String formats to connect with different types of DataBase.

Connection String Formats

To connect with the Ms-Access 2003 DataBase Connection String Format:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Full Path of the DataBase File with Extension (".Mdb");Persist Security Info=True;Jet OLEDB:Database Password=********

To connect with the Ms-Access 2007 DataBase Connection String Format:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Full Path of the DataBase File with Extension (".accdb");Persist Security Info=True;Jet OLEDB:Database Password=********

To connect with the SQL Server DataBase Connection String Format:

DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DataBaseName.mdf;
Integrated Security=True;User Instance=True

To connect with the MYSQL DataBase Connection String Format:

DataSource=Sever Name;DataBaseName=DataBase File Name;
UserName="Name";Password=*******

To connect with the Oracle DataBase Connection String Format:

Data Source=MyOracleDB;User Id=myUsername;Password=********;
Integrated Security=no;

I hope this will help New developers in ADO.Net Programming.

Read more about connection strings : http://www.connectionstrings.com/

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s