We use Entity Framework 5, but have a requirement to ALSO use a normal database connection from the application for some custom SQL we need to perform.
So, I am creating
Yes you can.
See here for 3 options.
1 - use separate connection string for each
2 - extract it from your entity object (this is what i think you want)
3 - use the entity object to execute your custom SQL
Here's how to do nr 2:
using System.Data.EntityClient;
using System.Data.SqlClient;
...
private string GetADOConnectionString()
{
SalesSyncEntities ctx = new SalesSyncEntities(); //create your entity object here
EntityConnection ec = (EntityConnection)ctx.Connection;
SqlConnection sc = (SqlConnection)ec.StoreConnection; //get the SQLConnection that your entity object would use
string adoConnStr = sc.ConnectionString;
return adoConnStr;
}