| Author: kumar 08 Aug 2008 | Member Level: Diamond | Rating: 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 2008 | Member Level: Gold | Rating: 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 2008 | Member Level: Silver | Rating: 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 2008 | Member Level: Gold | Rating: 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 2008 | Member Level: Gold | Rating: 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;
|