这是在App_Code里的一个CS数据操作文件:
但我就是没有找到"Pr_UpdateCategoryOrder"在哪?
在相关页面cs文件里也没有?
请指点,解决马上结账!
public int UpdateCategoryOrder(int categoryID,string moveFlag)
{ ///获取连接字符串
string connectionString = ConfigurationManager.ConnectionStrings["SQLCONNECTIONSTRING"].ConnectionString;
///创建连接
SqlConnection con = new SqlConnection(connectionString);
///设置被执行存储过程的名称
string cmdText = "Pr_UpdateCategoryOrder";
///创建SqlCommand
SqlCommand cmd = new SqlCommand(cmdText,con);
///设置执行方式为存储过程
cmd.CommandType = CommandType.StoredProcedure;
///创建参数并赋值
cmd.Parameters.Add("@ID",SqlDbType.Int,4);
cmd.Parameters.Add("@MoveFlag",SqlDbType.VarChar,20);
cmd.Parameters[0].Value = categoryID;
cmd.Parameters[1].Value = moveFlag; int result = -1;
try
{ ///打开连接
con.Open();
///操作数据
result = cmd.ExecuteNonQuery();
}
catch(Exception ex)
{   ///抛出异常
throw new Exception(ex.Message,ex);
}
finally
{   ///关闭连接
con.Close();
} return result;
}

解决方案 »

  1.   

    ///设置执行方式为存储过程 
    cmd.CommandType = CommandType.StoredProcedure;
    躲在数据库里!昏倒,你没看到是执行的存储过程么?
      

  2.   

    你在连接的那个数据库里打sp_helptext Pr_UpdateCategoryOrder
    就可以看到存储过程里写的啥了!
      

  3.   

    Pr_UpdateCategoryOrder是存储过程的名称。在数据库的存储过程中应该能找到
      

  4.   

    在数据库里找Pr_UpdateCategoryOrder这个存储过程...
      

  5.   

    存储过程"Pr_UpdateCategoryOrder"是在SQL数据库里的。。
      

  6.   

    ///设置被执行存储过程的名称 
    string cmdText = "Pr_UpdateCategoryOrder"; 
    ///创建SqlCommand 
      

  7.   

    在sqlserver的数据库里面存储着
      

  8.   

    哦  那请问在哪查看到啊   我是SQL 2005的数据库
      

  9.   

    SqlCommand cmd = new SqlCommand(cmdText,con); 
    ///设置执行方式为存储过程 
    cmd.CommandType = CommandType.StoredProcedure; 
    ///创建参数并赋值 
      

  10.   


    use [数据库名]
    gosp_helptext  Pr_UpdateCategoryOrder 
    go
      

  11.   

    Pr_UpdateCategoryOrder is a stored porcedure name, will perform the stored procedure and excute in the SQL