string server = "192.168.1.28";
string database = "xxxxxx";
string uid = "yyyyy";
string password = "zzzzz";
string connectionString;
connectionString = "SERVER=" + server + ";" + "DATABASE=" +
database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
SqlConnection conn = new SqlConnection(connectionString);
ada = new SqlDataAdapter("select * from markdetail", conn);
ds = new DataSet();
ada.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
我使用此代碼MySQL數據庫連接到我的C#project.But它這樣表示 Mysql數據庫未連接到C#?
錯誤信息如何解決這個任何人有想法?
在哪一行?你調試了你的代碼嗎?你確定你的連接字符串是正確的嗎? –
這裏可能解決[此處輸入鏈路描述] [1] [1]:http://stackoverflow.com/questions/6454809/sqlexception-was-unhandled –
'ada.Fill(DS)'中這一行@SonerGönül –