我需要你的帮助。C#连接到mysql服务器
我这是说的错误消息:
"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)".
我试图连接使用的IP其它本地计算机本地主机。 我的代码:
public DbStudent()
{
UGIcon = new SqlConnection();
UGIcon.ConnectionString = "server= IPAddress;user="id";password="pass";database=MyDB";
}
public SqlConnection Open()
{
UGIcon.Open();
return UGIcon;
}
public void Close()
{
UGIcon.Close();
}
请问有人能帮我吗?
你的标题具有的MySql而你的错误是关于SQL Server的,你想用'SqlConnection'连接到MySQL数据库吗? – Habib 2013-03-11 08:00:25
是的,有可能吗?或者你可以给我另一种方式来连接mysql? – Wiranata 2013-03-11 08:02:31
我不明白你的代码是如何编译的:你的连接字符串包含未转义引号...... – Kek 2013-03-11 08:03:08