I just started playing with ASP.NET MVC.
<add name="ApplicationServices" connectionString="Data Source=localhost;Port=3306;Database=test;User id=root;Password=admin;" providerName="MySql.Data.MySqlClient" /> <add name="testEntities" connectionString="metadata=res://*/Models.testDB.csdl|res://*/Models.testDB.ssdl|res://*/Models.testDB.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;port=3306;database=test;User Id=root;password=admin"" providerName="System.Data.EntityClient" />
VS automatically creates connection strings in the web.config file with database data when adding an ADO entity data model. The problem is that I am using the ASP.NET user / privilege scheme, which uses the "ApplicationServices" connection string, which exists by default. All these tables, as well as my application tables, exist in the same database. I want the database data (host / user / pass) to come from one line of the connection string. Or even if there are several lines of connection string, you can get database data separately from one source.
I came from the world of PHP and could not figure out how to do this from other similar threads that I came across.
thanks
source share