说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

方法调用出错!请高手帮忙!

编辑:说三道四文库 发布时间:2018-05-25 09:33
HTML文档下载 WORD文档下载 PDF文档下载
调用:          ke.ExeSql("insert into " + ClassTable + "(ClassID,ClassName,Depth,RootID,ParentID,ParentPath,OrderID,Child,Readme,OpenTarget,Checked,PrevID,NextID)values+(" + ClassID + ",'" + ClassName + "'," + Depth + "," + RootID + "," + ParentID + ",'" + ParentPath + "'," + PrevOrderID + "," + Child + ",'" + Readme + "'," + OpenTarget + "," + Checked + "," + PrevID +" ,0)");

方法:        public void ExeSql(string str_Sql)
        {
            Open();
            myCommand = new SqlCommand(str_Sql, myConnection);
            myCommand.ExecuteNonQuery();
            myCommand.Dispose();
        }

第 1 行: '+' 附近有语法错误
楼主你多加了个加号!
改为:
ke.ExeSql("insert into " + ClassTable + "(ClassID,ClassName,Depth,RootID,ParentID,ParentPath,OrderID,Child,Readme,OpenTarget,Checked,PrevID,NextID)values(" + ClassID + ",'" + ClassName + "'," + Depth + "," + RootID + "," + ParentID + ",'" + ParentPath + "'," + PrevOrderID + "," + Child + ",'" + Readme + "'," + OpenTarget + "," + Checked + "," + PrevID +" ,0)");
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘