Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Connection string - username and password?

Author  Topic 

memento
Starting Member

16 Posts

Posted - 2006-06-07 : 05:31:20
I am developing a website with another person and the database is in my computer.

In my computer the connection string is

Data Source=localhost;Initial Catalog=dataTrial2;Integrated Security=True

For it to work in the other computer we needed to change the data source to my computer's name (ASUS).
The problem is that we get the error

login failed for user '.' this user is not associated with a trusted sql server connection 


We can only make it work if we specify a username and password in the connection string that exists in the SQL Server.

I don't know much about security and permissions, but isn't it unsafe to have those written in plain text in the web.config file?
Is this the only way to connect to a database through a remote web interface? I'd think that the system would use the ASPNET login whenever there was a connection through a website.
Do I really need to create a specific user log in in SQL for these connections and write the u/p in the connection string?

JBelthoff
Posting Yak Master

173 Posts

Posted - 2006-06-07 : 06:25:12
If your web hosting and database hosting is with the same company, normally the connection with the SQL Login is behind a router and would never leave the local network.

However, if you are using a remote database to be secure you would want to connect using a Secure Sockets Layer - HTTPS.

Also there is a HasPasswordForStoringInConfig function you could check out but would not help in a remote dbase.

There are many ways to secure a connection. It all depends how far you want to take it.



JBelthoff
• Hosts Station is a Professional Asp Hosting Provider
• Position SEO can provide your company with SEO Services at an affordable price
› As far as myself... I do this for fun!
Go to Top of Page
   

- Advertisement -