Solved

MVC3 Connection String Issue

Posted on 2011-03-22
8
979 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: 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.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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