Solved

MVC3 Connection String Issue

Posted on 2011-03-22
8
969 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

11 Experts available now in Live!

Get 1:1 Help Now