Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法连接到任何指定的MySQL主机_C#_Mysql_Sql_Mysql Error 1064 - Fatal编程技术网

C# 无法连接到任何指定的MySQL主机

C# 无法连接到任何指定的MySQL主机,c#,mysql,sql,mysql-error-1064,C#,Mysql,Sql,Mysql Error 1064,我知道这是一个容易的问题,但我找不到错误。我想在数据库中保存数据。我使用Microsoft SQL Server 2008创建了一个名为“Examen”的数据库,然后在我的visual studio应用程序中创建如下连接字符串: string connectionstring = @"Data Source=.\sqlexpress;Initial Catalog=Examen;Integrated Security=True"; 然后,我使用以下代码将数据插入“测试”表: 运行此代码时,我在

我知道这是一个容易的问题,但我找不到错误。我想在数据库中保存数据。我使用Microsoft SQL Server 2008创建了一个名为“Examen”的数据库,然后在我的visual studio应用程序中创建如下连接字符串:

string connectionstring = @"Data Source=.\sqlexpress;Initial Catalog=Examen;Integrated Security=True";
然后,我使用以下代码将数据插入“测试”表:

运行此代码时,我在打开连接时出错

Unable to connect to any of the specified MySQL hosts.
你在混和和

是否确实要连接到MySQL服务器?如果要连接到MSSQL,请使用


您还应该熟悉

MySql和SQLServer是两种不同的野兽
Unable to connect to any of the specified MySQL hosts.