.net connection string for Sql server database
I am designing an application in .ne开发者_如何学Ct using MVC3. I am using Visual studio 2010 and i am using Sql Server for database. what connection string should i use in Web.Config file.?
Here is a site with any connection string you want:
http://www.connectionstrings.com/
Basically, you should probably use something like this:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
This way you are using trusted security (not storing a SQL username and password in your config file). You will just need to make sure that the account that your application runs under has access to the database. Really, though, you should have a data access layer that has the permissions. I would recommend against direct data access from your front-end. If possible, maybe even WCF.
精彩评论