Data source for connection string in Web.config
For me Connection strings could be hard to remember. Its very easy to make a mistake when you write it manually. One advice is to use the server explorer to connect to your database. Then right click on your database icon > select properties ... you will see the connection string copy and paste . Voilà!
If you still have problem then remove the integrated security setting
Server Explorer:
Properties:
challengeAccepted
Updated on June 05, 2022Comments
-
challengeAccepted almost 2 years
I was wondering what should be the data source for the connection string in Web.config
My SQL Database explorer looks like 198.57.59.70(SQL Server 10.50.1600 - RAM\ServerAdmin) under which i have databases. When i use this, i get as Network to the database does not exists. When i use Data Source=198.57.59.70, i get an error "System.Data.SqlClient.SqlException: Login failed for user 'RAM\IWPD_3" This is in asp.net 3.5 in Windows server 2008 for deployment. Thank you!
Can some one guide me, Thank you!!
<connectionStrings> <add name="ConnectionString" connectionString="Data Source=198.57.59.70(SQL Server 10.50.1600 - COMM\ServerAdmin);Initial Catalog=Tracking;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/> </connectionStrings>
-
challengeAccepted almost 11 yearsWhen i have connectionString="Data Source=198.57.59.70;Initial Catalog=Tracking;Integrated Security=SSPI;" i still get error. I did try the way you told me too. But in vain! :-(
-
challengeAccepted almost 11 yearsI am assuming you did not finish the answer. Isn't it?
-
Sandesh over 10 yearsbut this is possible when you are adding database in your project. Explain what to do when external database is used with project.
-
meda over 10 years@Sandesh external? this should work for everything as long as connected through the wizard, connection string will always be in the properties
-
Sandesh over 10 years@meda I am currently using Sql Server 2005 and 2008 R2 management. Then here How can you find connection string ?
-
meda over 10 years@Sandesh I update my post with screenshot let me know if its helpful.
-
Sandesh over 10 years@meda yes its definitely its helpful.... but will you please tell me how to find conne. string in sql server 2005 like this.
-
meda over 10 yearsYou need the connection string for Visual studio Dont you?
-
meda over 10 yearsYes for iternal you would just grab it directly.The example I gave is using external DB, see server explorer screen shot that where you connect to it, use ODBC.