Solved

Error connecting to a localhost database

Posted on 2011-03-24
2
258 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now