1
我有這樣的代碼:Excepion與MysqlCommand和「SET @q:」變量C#?
using (MySql.Data.MySqlClient.MySqlConnection cn = new
MySql.Data.MySqlClient.MySqlConnection(
Properties.Settings.Default.CONNNConnectionString))
{
cn.Open();
MySql.Data.MySqlClient.MySqlCommand cm = new
MySql.Data.MySqlClient.MySqlCommand();
cm.CommandType = CommandType.Text;
cm.Connection = cn;
cm.CommandText="CREATE PROCEDURE `GetMovement`(RefArtt vARCHAR(20),idos INTEGER) "+
"BEGIN "+
"SET @Qt=0; "SELECT * ,@Qt:[email protected]+qteliv-qtesor as stock FROM tableInOut;"+
"End";
cm.ExecuteNonQuery();}
例外:您的SQL語法錯誤;檢查對應於您的MySQL服務器版本的手冊 正確的語法爲 在''@ Qt'= 0附近使用; SELECT * ...
你宣佈@Qt? – DidIReallyWriteThat 2014-10-07 13:22:21
作爲參數是 – 2014-10-07 15:08:47