Answered by:
Getting Error: The underlying provider failed on Open

Question
-
Hi there,
I am getting above error while executing below code, though it is working fine on another machine. please help me out
log.ActionId = (from x in context.ActionLookUps where x.ActionDescription == actionMessage select x).First().ActionId; context.UserLogs.Add(log);
- Moved by Amanda Zhu Thursday, February 14, 2013 3:23 AM
Wednesday, February 13, 2013 8:25 AM
Answers
-
Hi,
This exception gets thrown when something goes wrong connecting to the database. The inner exception should have details about why the connection failed if you check that then it should tell you what is happening.
Since this is working on other machines it is likely something to do with the permissions of the user executing the code or something to do with that specific machine communicating with the database.
If you let us know what the inner exception is then we can probably provide more info.
We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.
- Proposed as answer by Glenn CondronMicrosoft employee Wednesday, February 20, 2013 5:35 PM
- Marked as answer by Alexander Sun Tuesday, February 26, 2013 8:52 AM
Monday, February 18, 2013 11:42 PM
All replies
-
Hello Hartia,
I have moved this thread to ADO.NET Entity Framework and LINQ to Entities for better response.
Best regards,
Amanda Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Thursday, February 14, 2013 3:24 AM -
Hi Harita,
Could you please let me know which you are using? Entity Framework or Linq to SQL?
What is your database? SQL Server? SQL Compact? Or any others?
Best Regards,
Alexander Sun [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Thursday, February 14, 2013 9:30 AM -
Hi,
This exception gets thrown when something goes wrong connecting to the database. The inner exception should have details about why the connection failed if you check that then it should tell you what is happening.
Since this is working on other machines it is likely something to do with the permissions of the user executing the code or something to do with that specific machine communicating with the database.
If you let us know what the inner exception is then we can probably provide more info.
We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.
- Proposed as answer by Glenn CondronMicrosoft employee Wednesday, February 20, 2013 5:35 PM
- Marked as answer by Alexander Sun Tuesday, February 26, 2013 8:52 AM
Monday, February 18, 2013 11:42 PM