Solved

MVC3 Connection String Issue

Posted on 2011-03-22
8
976 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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