I'm trying to access a mysql database hosted online, but every time getting the same error. Here is the error message, code and web.config connectionStrings I used:
"An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code"
"Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
<div class="col-md-12">
@{
var db = Database.Open("SQLServerConnectionString");
var selectQueryString = "SELECT * FROM `emp`";
var data = db.Query(selectQueryString);
var grid = new WebGrid(data);
}
@grid.GetHtml()
</div>
<connectionStrings>
<add
name="SQLServerConnectionString"
connectionString= "server=**.***.***.*;database=Zain;uid=Zain;pwd=Zain123"
providerName="System.Data.SqlClient" />
</connectionStrings>