% w / w ( reference here ) is unique to SQL Server ( as in this LINQ response ). Without a third-party DLL it's almost impossible to connect.
According to my research there are other ways to connect MYSQL to C # and it is not exclusive to System.Data.SqlClient
. On this site I found some connector options for .NET:
I believe that MySql.Data.dll
is the most used, the rest should no longer be used in the market (difficult even to find references). Here's an example using MySQLDriverCS
found in this link .
using MySQLDriverCS;
using System.Data;
MySQLConnection myConn;
MySQLDataReader MyReader = null;
try
{
myConn = new MySQLConnection(new MySQLConnectionString("123.456.789.100",
"mydatabase",
"user",
"pass").AsString);
myConn.Open();
string sql = "SELECT * FROM Table";
MySQLCommand cmd = new MySQLCommand(sql, myConn);
MyReader = cmd.ExecuteReaderEx();
while (MyReader.Read())
{
Console.WriteLine( MyReader["Product_Name"].ToString() );
}
MyReader.Close();
}
catch(Exception ee)
{
Console.WriteLine( ee.ToString() );
}
finally
{
if (MyReader != null && !MyReader.IsClosed)
{
MyReader.Close();
}
if (myConn != null && myConn.State == ConnectionState.Open)
{
myConn.Close();
}
}
What I noticed is VERY similar to MySQLDriverCS
.