I have a MVC project(data base first) with one SQL connection string.for applying this connection I use this way and it's connected correctly:
http://www.c-sharpcorner.com/UploadFile/8a67c0/database-first-approach-with-Asp-Net-mvc-step-by-step-part-2/
But, My problem is about applying another connection at run time with MySQL database.In fact, I have several forms which need to SQL connection and several forms which need MySQL connection.On the other hands, MySQL connection must be set at run time.
So, I have two important questions:
1-How can I set MySQL connection string at run time (in associated my model)
2-How can I switch between two connections in different views in running project.
for more explanation you could see my model for creating MySQL connection as below:(these fields are set in view, after posting view connection must be connected)
public partial class BPMEngine
{
public int EngID { get; set; }
public string EngName { get; set; }
public string DBServer { get; set; }
public string DBName { get; set; }
public string DBUserName { get; set; }
public string DBPass { get; set; }
public string EngURL { get; set; }
public string AppRootPath { get; set; }
}