Click here to Skip to main content
14,733,037 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello people,
I have a .net application which uses a database for its data source.
I have a copy of SQL Server 2008(to be installed) and i would like to know how i can determine my connection string(ADO.net):
the SQL server will be installed on one machine(server) in a network of 5 machines. the 4 client machines will need to access the server for data queries and also to upload simple files to the server directory.
Posted

Check this site, they have sample connection strings for almost all the databases.
http://www.codemaker.co.uk/it/tips/ado_conn.htm[^]
   
Comments
[no name] 19-Oct-11 22:27pm
   
You mean like the link that was posted 16 hours ago and is the recognized defacto authority for connection string information
Install the Sqlserver
installation ask for named instance or default instance
for named instance connection string will be
string strSql = @"server=ServerName\SqlInstanceName;uid=sa;password=SqlPassword;database=DbName";

for default instance connection string will be
string strSql = @"server=ServerName\SqlInstanceName;uid=sa;password=SqlPassword;database=DbName";

SqlConnection cn = new SqlConnection(strSql);



ServerName = server on which sql server is installed
SqlInstanceName = sql server instance
SqlPassword = sql server password given at installation time
DbName = database name to which application is going to be connected.
   
v3
Comments
[no name] 19-Oct-11 22:25pm
   
Your connection strings are the same.

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




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900