Connect to SQL Server with username and password

I am writing a C # application for deployment on another machine. The deployment machine is a clean install of Windows 7.

On my development machine (32-bit Windows 7 virtual machine), I installed SQL Server 2008 R2 and Visual Studio Express 2010. I would like to create a new database and require its authentication from the application to connect. All the training materials that I find speak about the wind over part of the connection string, I can not find it explained anywhere. In fact, I can’t even figure out how to add a new user and password for SQL Server in SQL Server Management Studio.

How to add a new user and password in SQL Management Studio 2008 R2 so that I can easily install another instance of SQL Server on another machine and move the database to it?

Thanks.

+1
c # sql-server visual-studio
source share
2 answers

first check the authentication mode of your database: connect to your database on SSMS, right-click on it, go to "Properties" and then "Security". Verify that SQL Server and Windows Authentication Mode is selected. This will allow you to create logins.

Then create your login: connect to your database on SSMS, expand your database, then go to "security" and right-click on the inputs, and then click "new login"

then create your user: go to the security folder inside your database, right-click users and "new user". Provide the username and login you created earlier. Do not forget to add the necessary permissions

About connection strings, this is a very good website, as already stated:

http://www.connectionstrings.com/ 
+2
source share
+3
source share

All Articles