Click here to Skip to main content
12,633,990 members (24,415 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

20.7K views
8 bookmarked
Posted

How to connect with different types of DataBase?

, 25 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.

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=*******"

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Manoj K Bhoir
Software Developer
India India
It always seems good to hear about me, but the thing I do is I code. I'm Interested in Designing Windows Based Application, Web Applications and building Mobile Applications. Currently restricting it to Android 4.0 applications, building Internet Based Applications using ASP.NET and contributing to bring the student community to a position which will help technology to reach the greatest heights ever. A very Big fan of Microsoft & Android..!!

You may also be interested in...

Pro

Comments and Discussions

 
Generalvery nice article Pin
prashant kolekar2-Dec-11 3:07
memberprashant kolekar2-Dec-11 3:07 
GeneralReason for my vote of 1 Agree with John, Richard and Mika. -... Pin
SAKryukov26-Nov-11 14:15
mvpSAKryukov26-Nov-11 14:15 
GeneralReason for my vote of 1 See Mika's alternative; something y... Pin
Richard MacCutchan26-Nov-11 4:03
mvpRichard MacCutchan26-Nov-11 4:03 
GeneralReason for my vote of 1 I'm at a complete loss as to why thi... Pin
John Simmons / outlaw programmer26-Nov-11 2:53
mvpJohn Simmons / outlaw programmer26-Nov-11 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 25 Nov 2011
Article Copyright 2011 by Manoj K Bhoir
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid