1 Attachment(s)
Entity Framework connection string issue
I am using EF connection string in my project,and it doesnt work. i will post my code and can anyone tell me how to rebuild debug.appconfig and relase.appconfig bcuz i have an error to
Attachment 163079
Here is my connection string code :
Code:
<add name="dentnedEntities" connectionString="data source=DESKTOP-Q8526KR\SQLEXPRESS;Integrated Security=SSPI;
database=dentned;
AttachDBFilename=|DataDirectory|dentned.mdf;
User Instance=true"
providerName="System.Data.SqlClient" />
I have create another one and it doesnt work here is the 2nd code :
Code:
<add name="dentnedEntities" connectionString="metadata=res://*/Entity.Model_dentned.csdl|res://*/Entity.Model_dentned.ssdl|res://*/Entity.Model_dentned.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-Q8526KR\SQLEXPRESS;initial catalog=dentned;Integrated Security=true; MultipleActiveResultSets=True;App=EntityFramework"" />
Re: Entity Framework connection string issue
delete that second one... it's jsut too wrong to fix. The first one... I don't know how you managed to mangle that one... but you've managed to mix two connection types there. First thing you need to decide is if you're connecting to a database on a SQL Server instance, or if you're wanting to connect to a database file... once you decide that, you then need to delete the parts that are for the other connection type. If you need help pop over to https://www.connectionstrings.com/sqlconnection/ for a properly formatted connection string.
-tg