瀏覽單個文章
企Gre
Major Member
 
企Gre的大頭照
 

加入日期: Apr 2001
您的住址: 台北.台灣
文章: 156
請c#高手幫忙一下@@ 想一天了!! 無解

在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);
     
      
__________________
不知道為什麼來,沒有留下什麼..卻只帶走一些遺憾!
投資等於賭博??
舊 2011-10-23, 10:03 PM #1
回應時引用此文章
企Gre離線中