|
Major Member
|
在2010 VC# 底下
==============================================
mysql mydb
[coid (key)] [cowhere] [comoney] [coincome] [comons] [coday conote]
==============================================
private void button3_Click(object sender, EventArgs e)
{
int coid = Int32.Parse(nmbBox2.Text);
string cowhere = wh2Box4.Text;
string comoney = moneyBox5.Text;
string conote = noteBox6.Text;
string connStr = "server=localhost;user=root;database=mydb;port=3306;password=;Charset=utf8";
MySqlConnection conn = new MySqlConnection(connStr);
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "updata expenses set cowhere=@cowhere,comoney=@comoney , conote=@conote where coid=@coid ";
cmd.Prepare();
cmd.Parameters.AddWithValue("@cowhere", cowhere);
cmd.Parameters.AddWithValue("@comoney", comoney);
cmd.Parameters.AddWithValue("@conote", conote);
cmd.ExecuteNonQuery();
每次都會說錯誤!! 實在無解!!
conn.Close();
button1_Click(this, e);
__________________
不知道為什麼來,沒有留下什麼..卻只帶走一些遺憾!
投資等於賭博??
|