Link to home
Start Free TrialLog in
Avatar of Ann K
Ann K

asked on

SQL Login

How to create the sql login on a database? I am keep getting error in my program when try to access the SAMPLE database.

Login failed for user 'IIS APPPOOL\ASP.NET V4.0 Integrated'

User generated image
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

  1.    In SQL Server Management Studio, open Object Explorer and expand the Databases folder.
  2.    Expand the database in which to create the new database user.
  3.    Right-click the Security folder, point to New, and then click User (The second one in your screenshot).
  4.    On the General page, enter a name for the new user in the User name box.
  5.    In the Login name box, enter the name of a SQL Server login to map to the database user.
  6.    Click OK.
And to assign permissions
  1. Select your SQL database, Expand database name then select the table residing in that database for which you want to assign the required permissions to that database user
  2. Right click on that table, and select Properties.
  3. Click on Permissions option from Table Properties dialog box
Avatar of Ann K
Ann K

ASKER

I just want to make sure I did it right.
Login name  ---> sa
Default Database--> Sample

User generated image
Avatar of Ann K

ASKER

But i got an error.
User generated image
Avatar of Ann K

ASKER

I tried a different name but still error.
User generated image
SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ann K

ASKER

i use HARRIS-PC\Guest and this time it accept it. But I am still getting the same error in my visual studio 2010 program.
Avatar of Ann K

ASKER

I give the rights to guest but its showing DBO.
User generated image
in a non-domain environment to connect from other machines you need to use SQL authentication, you are trying to use just Windows Authentication. You also have to open ports 1433-1444
Avatar of Ann K

ASKER

Can you please tell me in step by step instruction how to i do that. Also SQL Server 2014 and visual studio 2010 both are installed on same computer.
Avatar of Ann K

ASKER

I create another login with this name.

IIS APPPOOL\ASP.NET v4.0

But stil same error in my application.
User generated image
That is a service account don't use it use a regular account.
Avatar of Ann K

ASKER

Also tried to change the query string in web.config file but same error.
connectionString="Persist Security Info=False;User ID='HARRIS-PC\Guest';Password='';Initial Catalog=Sample;Server=."

Open in new window

User generated imageUser generated image
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ann K

ASKER

Still same error.
          connectionString="Persist Security Info=False;User ID='Ann';Password='Troy12';Initial Catalog=Sample;Server=."

Open in new window

User generated imageUser generated image
Avatar of Ann K

ASKER

Shifting tables to master database doesn't help either.
User generated image
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial