Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am trying to connect to databse in mVC 5 i ma getting this error ...
Web.config : connection string
XML
<add name="SchoolContext" connectionstring="Data Source=Sayeed\SQLEXPRESS;Database=Say;Integrated Security=false" providername="System.Data.SqlClient" />


The beow are the error line which occurs any solution to solve this..
An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: The underlying provider failed on Open.
Posted
Updated 31-Jul-16 0:05am
v2
Comments
Maciej Los 16-Dec-14 3:52am    
Post connection string!
sahmed3 19-Dec-14 11:09am    
Los,
the Issue has been resolved i just given wrong system name.
Joshua Masa 13-May-15 5:08am    
So, what's the correct System name then?
King Fisher 16-Dec-14 6:00am    
Make sure your DbContext class name as same with Connection Name
sahmed3 19-Dec-14 11:09am    
the Issue has been resolved i just given wrong system name.

If you disable Integerated Security, then you would normally have to provide login information - which you don't.

So start by getting a "good" connection string.
Try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.
 
Share this answer
 
Comments
Member 12698120 26-Nov-16 4:42am    
thanks a lot..god bless u:)
Nabin Jha 27-Nov-17 5:42am    
thanks a lot..this solution helped.. :)
OriginalGriff 27-Nov-17 5:57am    
You're welcome!
you can change in app.config like this: persist security info=True;user id=admin;password=123456;
I have problem like you when in my connectionStrings miss Password, My problem is solved.
good luck
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900