Solved

Error connecting to a localhost database

Posted on 2011-03-24
2
262 Views
Last Modified: 2012-06-21
Hi, I'm using asp.net 3.5, C#, sql express with Adv feature on Windows 7 home premium PC
Here is my con string and the run time error:
Login failed for user 'Admin'. The user is not associated with a trusted SQL Server connection.
    <add name="ConString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Survey;User Id=Admin;Password=XXXXXXX"/>

I'm connecting using the SQL login and not Windows's login.  Why am I getting this error?  In the SSE 2005 I created this UserId, select sql login, permissions is also granted for this database so I don't know why am I getting this error.
Ok I tried logging into my sal server using this user id and I got the same error msg"
TITLE: Connect to Server
------------------------------

Cannot connect to NEO\SQLEXPRESS.

------------------------------
ADDITIONAL INFORMATION:

Login failed for user 'Admin'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18452&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
0
Comment
Question by:lapucca
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 35212209
It is likely that your security mode is set to windows authentication.
In SQL Server Management Studio right cclick the server name and select properties.
Click the security tab
Click Server and Windows.
Click Ok
You will then be prompted to rstart the SQL Service, click Yes

http://msdn.microsoft.com/en-us/library/ms188670(v=SQL.90).aspx
0
 

Author Closing Comment

by:lapucca
ID: 35212268
That's it.  I set the database to all both type of log in but forgot to do that for the server.  Thank you.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question