Solved

MVC3 Connection String Issue

Posted on 2011-03-22
8
970 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
 

Author Comment

by:aspnetdev
ID: 35204550
well even if its on same domain, its not working i keep getting that exception.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET Web Form Variables being reset 2 26
Syntax Error 2 47
Receiving a string from a WebService Push 21 38
Help with C#, MVC, razor. 6 23
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now