C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




connection string


Posted Date: 08 Aug 2008      Total Responses: 5

Posted By: kali raj       Member Level: Gold     Points: 1


need connection string for access and sql server



Responses

Author: kumar    08 Aug 2008Member Level: DiamondRating:     Points: 1
Hi,

Pls refer

http://www.connectionstrings.com/
http://www.carlprothman.net/Default.aspx?tabid=81

thanks and regards,
Kumar


Author: fayaz    08 Aug 2008Member Level: GoldRating: Revenue Score: 0     Points: 0
for sql server

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

for access

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;




Author: Nagesh    08 Aug 2008Member Level: SilverRating:     Points: 2
Hi,

One tip: Always try to connect to database directly through the application so that we will never go wrong.

Regards,
Nagesh


Author: Mohanakrishnan    09 Aug 2008Member Level: GoldRating:     Points: 3
hi,

For sqlserver

SqlConnectin con = new SqlConnection("server=<servername>;uid=<userid>; pwd=<password>; database=<databasename>")

Example:
SqlConnectin con = new SqlConnection("Server=localhost; uid=sa; pwd=; database= databasename");


Author: Vidhya    09 Aug 2008Member Level: GoldRating:     Points: 6
hi,

connection string for ms access:

ACE OLEDB 12.0

Standard security

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;


With database password
This is the connection string to use when you have an Access 2007 database protected with a password using the "Set Database Password" function in Access.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;

DataDirectory functionality

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;

connection string for sqsl server:

OLE DB, OleDbConnection (.NET)

Standard

Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=myPath\myData.sdf;

COPY TO CLIPBOARD
How to specify the location of the SDF file
Often times the .SDF database is not running in the current directory so it becomes necessary to programatically set the path to the SDF file. This is an example (.net C#) on how to do this when the SDF file is located in the same directory as the executing application.
Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\MyData.sdf;




Post Reply
You must Sign In to post a response.
Next : Garbage Collector
Previous : To Anil Pandey
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use