Tuesday, February 14, 2012

connection string

my web site is in a host. my mssql db is in other host. how I write the connection string. Please help.

You should bookmark this page:http://www.connectionstrings.com/

Now you will never have to ask about a connection string again Big Smile

|||

<

configuration><connectionStrings>

<

addname="connectionName"connectionString="Data Source=ServerName;Initial Catalog=DBName;
User ID=userName;Password=p@.ssw0rd;Persist Security Info=True;"providerName="System.Data.SqlClient"/>

</

connectionStrings>

HTH

|||

JRICE:

<configuration>

<connectionStrings>

<addname="connectionName"connectionString="Data Source=ServerName;Initial Catalog=DBName;
User ID=userName;Password=p@.ssw0rd;Persist Security Info=True;"providerName="System.Data.SqlClient"/>

</connectionStrings>

My understanding of the original question is that the poster wants to connect to a remote instance of SQL Server.

|||

Mikesdotnetting:

JRICE:

<configuration>

<connectionStrings>

<addname="connectionName"connectionString="Data Source=ServerName;Initial Catalog=DBName;
User ID=userName;Password=p@.ssw0rd;Persist Security Info=True;"providerName="System.Data.SqlClient"/>

</connectionStrings>

My understanding of the original question is that the poster wants to connect to a remote instance of SQL Server.

in theData Source=ServerName .. place you database server ip with the port ... e.g if your server is in 192.168.2.100 ... and sql port is 9989 then use

Data Source=192.168.2.100,9989 ......

hope it helps you..

|||Thanks for your helping.|||Thank U too.

No comments:

Post a Comment