日期:2014-05-18  浏览次数:20489 次

请问这里为什么出错
我用储存过程
错误是
未能找到存储过程   ' '。  

                System.Text.StringBuilder   strAdd   =   new   System.Text.StringBuilder();
                strAdd.Append( "CREATE   PROCEDURE   #spAddOrder ");
                strAdd.Append( "@id   integer   out ");
                strAdd.Append( "as ");
                strAdd.Append( "Insert   into   [cloud]   (id,   name,   num)   values(@id,   ' "   +   idName.Text   +   " ',   "   +   idNum.Text   +   "); ");

                command.CommandType   =   CommandType.StoredProcedure;
                command.CommandText   =   strAdd.ToString();

                //   设置参数
                SqlParameter   param;
                param   =   command.Parameters.Add( "@id ",   SqlDbType.Int);
                param.Direction   =   ParameterDirection.Output;

                command.ExecuteNonQuery();

------解决方案--------------------
未能找到存储过程!!!已经提示的很清楚了,还不知道什么错?
需要调用的存储过程是已在SQL中有的,不是动态写的。
------解决方案--------------------
貌似你的存储过程还没有创建阿
------解决方案--------------------
jf
------解决方案--------------------
可以动态创建,但是存储过程必须在调用执行之前就必须已经在数据库中。