Solved

MVC3 Connection String Issue

Posted on 2011-03-22
8
973 Views
Last Modified: 2012-05-11
Hi,
I have created a web application using MVC3 and .NET4 and SQL Server 2008. Everything works good if i run it locally on my machine. But i try to connect to our development database (SQL Server 2008 with Compatibility set to 2008) i keep getting error :
If i make my connection string as
<add name="OFREntities" connectionString="metadata=res://*/OFR.csdl|res://*/OFR.ssdl|res://*/OFR.msl;provider=System.Data.SqlClient;provider connection string=&quot;Integrated Security=true;Initial Catalog=MA;Data Source=DEV50SQL;Persist Security Info=True;User ID=MASTool_User;Password=admin;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
Error i get :
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

If i make Integrated Security=false in above connection string i get following error :

System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.


Im confused, Can anyone help me out with this?
Thanks,
0
Comment
Question by:aspnetdev
  • 5
  • 3
8 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35197698
Ok, basics first. Is your Dev SQL Server on the same domain as your local machine? You also shouldn't have both Integrated Security and Username/password in the connection string, you should be using one or the other.
0
 

Author Comment

by:aspnetdev
ID: 35198136
No, the dev SQL server is on different domain
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35198196
Then that's your problem. You won't be able to authenticate against a SQL Server on a different domain unless there is a shared trust between them. And even then you will need to add your domain user as a valid login on the remote SQL Server.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:aspnetdev
ID: 35204550
well even if its on same domain, its not working i keep getting that exception.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35204881
First off, remove "Integrated Security" from the connection string and see if it is able to authenticate using the userid and password.
0
 

Author Comment

by:aspnetdev
ID: 35206431
I removed integrated security and still same issue
0
 

Accepted Solution

by:
aspnetdev earned 0 total points
ID: 35802531
got the resolution, there was an issue with HP Ployserv clustring. Entity Frame work and Polyserve do not go well together. We had 3 level of aliasing and had to go with 1 level alias and it solved the issue.
0
 

Author Closing Comment

by:aspnetdev
ID: 35829911
I found out resolution by myself
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

831 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