Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error connecting to a localhost database

Posted on 2011-03-24
2
Medium Priority
?
270 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

885 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