SQL 2008 Express database user name and password
I have published my ASP.Net MVC 2 application. I have a login service which works localy but when I try to do the same things online I have a problem. I had to edit the web.config file to point to the database on the web server. Also i hade to provide a username and password to access this database but i haven't set any. The connection string looks like this:
<add name="ApplicationServices"
connectionString="Server=servername;Database=database;Uid=uid;Password=pwd"
providerName="Syst开发者_开发问答em.Data.SqlClient" />
I can not leave the uid and password empty because i am getting an error. I think i have to add a username and password to my database but I dont know how to do it. I have googled a lot but found nothing. Hope someone can help
This site is a good resource for connection string info:
http://www.connectionstrings.com/sql-server-2008
You probably want to use a trusted connection until you create some users in your DB.
Something like this:
<add name="ApplicationServices"
connectionString="Server=servername;Database=database;Trusted_Connection=True;"
providerName="System.Data.SqlClient" />
When/if you start to add users to the database take a look at this link:
http://www.databasedesign-resource.com/adding-users-in-sql-server.html
精彩评论