Click here to Skip to main content
15,035,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a website where I need to fetch data from a SQL Server 2008 R2 database. But I'm getting an error

Login failed for user domain\Username&;

I googled for it then I get that to change property of SQL Server-> Properties -> Security -> Server authentication to SQL Server and Windows authentication mode only m still getting the same error. I dont want to use ID and password in connection string

What I have tried:

Connection String

<add name="DB_FRSConnectionString">
connectionString="Data Source=servername;Initial Catalog=databasename;Integrated Security=True"
providerName="System.Data.SqlClient" />
Posted
Updated 24-Feb-16 2:08am

1 solution

I would think the "how to fix" this error would be very simple. Sql told you that domain\username could not log into sql. You need to go into Sql server and create a login for that account.
   
Comments
Member 12346179 24-Feb-16 9:09am
   
But I can read/write database from visual studio.
ZurdoDev 24-Feb-16 9:10am
   
To the same db and using the domain\username from the error?
Member 12346179 24-Feb-16 9:17am
   
Yes same DB and same domain\Username
ZurdoDev 24-Feb-16 9:26am
   
Open Sql management studio and see if you can connect using windows authentication. Something has to be different and since we can't see it you'll have to find it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900