-1
我嘗試商店索姆數據到MySQL數據庫上localhos 但我得到這個消息: 用戶登錄字段「根用戶「根」登錄場...本地主機的Mysql
IM肯定uid和pws是正確的。
private void button1_Click_1(object sender, EventArgs e)
{
String connection = "server=localhost; user =root; Pwd=password;database=skradderi;";
SqlConnection conn = new SqlConnection(connection);
SqlCommand cmd = new SqlCommand("INSERT INTO kunder(Namn ,Adress ,telfon ,OrgNr)VALUES ('" + txtboxName.Text + "','" + txtboxAdress.Text + "','" + txtboxPostNr.Text + "','" + txtOrgNr.Text + "')");
try
{
conn.Open();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
您是否嘗試過「server =(local); ...」而不是「server = localhost; ...」? Ref:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx –
所有連接字段 – user2269364