2

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>
4
  • you are not providing username and password along with this Commented Jul 12, 2013 at 3:32
  • The authentication of SQL server is Windows Authentication. Hence , no Username and Password! Commented Jul 12, 2013 at 3:38
  • @Md.ParvezAlam Any other idea?! Commented Jul 12, 2013 at 3:46
  • try adding, Trusted_Connection=yes; Commented Jul 17, 2013 at 9:52

2 Answers 2

6

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:

enter image description here

Properties:

enter image description here

Sign up to request clarification or add additional context in comments.

8 Comments

When 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! :-(
but this is possible when you are adding database in your project. Explain what to do when external database is used with project.
@Sandesh external? this should work for everything as long as connected through the wizard, connection string will always be in the properties
@meda I am currently using Sql Server 2005 and 2008 R2 management. Then here How can you find connection string ?
@Sandesh I update my post with screenshot let me know if its helpful.
|
0

For SQL if you're using integrated security, your connection string data source should just be the computer name (or IP address) or the computer name IP\instance name if you're running named servers. You shouldn't need "(SQL Server 10.50.1600 - COMM\ServerAdmin)" in the data source.

Also, make life a little easier and don't name it "ConnectionString," as this is redundant. Instead, describe the resource you're connecting to. Assuming the IP is correct and your server is allowing remote connections, your connection string should look something like this:

<add name="TrackingDataStore" connectionString="Data Source=198.57.59.70;Initial Catalog=Tracking;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

1 Comment

I am assuming you did not finish the answer. Isn't it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.