Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to connet to SQL Server newbie?
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00940862
Message ID:
00941078
Vues:
8
You don't need to change your Enterprise Manager connection settings to your local database in order to use SQL Server Authentication.

You do need to have a username and password in order to connect to SQL Server if you are using SQL Server authentication in your application, however. You can use the built-in sa username, but it is never advisable to use the sa login in your application. Do the following:

1. Open Enterprise Manager (EM).
2. In EM:
A. Open your local server
B. Open the Security folder
C. Select Logins. Here you will see the logins that already exist
on your local SQL Server server. One of these will be "sa", the
system administrator login. You should set a password for this
if you haven't already. To do this, right-click on sa and select
Properties. In the dialog box that comes up, type a password,
click OK and then confirm the password. You can now use
"User ID=sa; Password=MyPassword" in your connection string.
D. To create a new login for your application, right-click on Logins
and select New Login...
E. Enter a new username.
F. Select "SQL Server Authentication"
G. Enter a password
H. Select the default database for that username
I. Although in a production application you would not
make the user an administrator, for the purposes of
making things easy in the learning stages on your own computer,
go to the Server Roles tab and check the System Administrators
checkbox. This will make this new user able to see all tables
and do anything on the database and you won't have to set
permissions on the tables you create while you learn basic
data access. Later you will need to learn how to set permissions
and have your application use non-administrator connections.
J. Click OK. Use the new username and password in your application.

Have fun!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform