当前位置: 代码迷 >> ASP.NET >> mycommand.ExecuteNonQuery();语句的结束位置缺少分号!真奇怪!该怎么解决
  详细解决方案

mycommand.ExecuteNonQuery();语句的结束位置缺少分号!真奇怪!该怎么解决

热度:5815   发布时间:2013-02-25 00:00:00.0
mycommand.ExecuteNonQuery();语句的结束位置缺少分号!!!真奇怪!!!
明明有分号,提示缺少分号。
添加的参数可以不用看。他提示是在mycommand.ExecuteNonQuery();处缺少分号。
    string   cmd3   =   "Insert   into   KHGL_Customer(cCusCode,cCusName,cCusAbbName,iDCID,cCusAddressMX,cCusSJName)   values(@cCusCode,@cCusName,@cCusAbbName,@iDCID,@cCusAddressMX,@cCusSJName)   where   iCustomerId= "   +   Temp;
                mycommand   =   new   OleDbCommand(cmd3,   myconnection);
                mycommand.Parameters.Add(new   OleDbParameter( "@cCusCode ",   OleDbType.Char,   20));
                mycommand.Parameters.Add(new   OleDbParameter( "@cCusName ",   OleDbType.VarChar,   50));
                mycommand.Parameters.Add(new   OleDbParameter( "@cCusAbbName ",   OleDbType.VarChar,   50));
                mycommand.Parameters.Add(new   OleDbParameter( "@iDCID ",   OleDbType.Char,   20));
                mycommand.Parameters.Add(new   OleDbParameter( "@cCusAddressMX ",   OleDbType.VarChar,   100));
                mycommand.Parameters.Add(new   OleDbParameter( "@cCusSJName ",   OleDbType.VarChar,   50));

                mycommand.Parameters[ "@cCusCode "].Value   =   cCusCode_Box.Text;
                mycommand.Parameters[ "@cCusName "].Value   =   cCusName_Box.Text;
                mycommand.Parameters[ "@cCusAbbName "].Value   =   cCusAbbName_Box.Text;
                mycommand.Parameters[ "@iDCID "].Value   =   iDCID_Box.Text;
                mycommand.Parameters[ "@cCusAddressMX "].Value   =   cCusAddressMX_Box.Text;
                mycommand.Parameters[ "@cCusSJName "].Value   =   cCusSJName_Box.Text;
                myconnection.Open();
                mycommand.ExecuteNonQuery();
                //添加确认对话框
                Response.Write( " <script> window.alert( '保存成功! ') </script> ");

                myconnection.Close();

------解决方案--------------------------------------------------------
没理解..
  相关解决方案