I am creating a MVC application. Using entity framework Db connection string included Appsettings.config and Entity framework connection auto generated in web.config its Working fine. After i planned to move the code to server i have server details Like
Connection string in Appsettings
Server Database :
<add key="thenna" value="server=123.45.45.34;database=montage;user id=*****;password=*******;trusted_connection=false;"/>
Local Database:
<add key="thenna" value="server=DESKTOP-QD6A981\SQLEXPRESS;database=tickandtie;user id=***;password=*****;trusted_connection=false;" />
when i which one i want i can use if server db want i was comment local db connection string code . web config entity framework Code :
<connectionStrings><add name="tickandtieEntities" connectionString="metadata=res://*/Entityframework.Tickmarks.csdl|res://*/Entityframework.Tickmarks.ssdl|res://*/Entityframework.Tickmarks.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-QD6A981\SQLEXPRESS;initial catalog=tickandtie;user id=sa;password=Tickmarks;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings>
when i move server code how can i change Web config code ? i need to use Same code or else i need use with server details? how to move this code server web config after publish the application ?
usernameand thepasswordof the server database?usernameandpasswordsupposed to be secret? You are showing it to the WORLD