Solved

Error connecting to a localhost database

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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