Adding user and password to Sql Server database

My connection string, defined in Web.Config, states that the user or password is not required:

<connectionStrings> <add name="CinemaxConnectionString" connectionString="Data Source=PCName\SQLEXPRESS;Initial Catalog=Cinemax;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> 

I would like to add a user and password, for example:

 <connectionStrings> <add name="CinemaxConnectionString" connectionString="Data Source=PCName\SQLEXPRESS;Initial Catalog=Cinemax;User=cinemax; Password=abc" providerName="System.Data.SqlClient" /> </connectionStrings> 

Obviously, for this you need to change some parameters on the Sql server to add a user and password . What is the best way to do this? I indicate that I have Sql Server 2005 Express, and the current authentication mode is "Sql Server and Windows Authentication" . Thanks in advance for your help. It would be nice to see a dual approach to this: the user interface and the code solution.

+4
source share
1 answer

Below are instructions for you.

 CREATE LOGIN cinemax WITH PASSWORD = 'abc'; GO CREATE USER cinemaxUser FOR LOGIN cinemax GO GRANT SELECT TO cinemaxUser GO GRANT INSERT TO cinemaxUser GO GRANT UPDATE TO cinemaxUser GO GRANT DELETE TO cinemaxUser GO 
+12
source

All Articles