日期:2014-05-18 浏览次数:20431 次
public int MoveDirectory(int nDirID, int nParentID) { SqlConnection con = DB.createDB(); int nResult = -1; SqlCommand cmd = new SqlCommand("Pr_MoveDirectory",con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter pDirID = new SqlParameter("@DirID",SqlDbType.Int,4); pDirID.Value = nDirID; cmd.Parameters.Add(pDirID); SqlParameter pParentID = new SqlParameter("@ParentID",SqlDbType.Int,4); pParentID.Value = nParentID; cmd.Parameters.Add(pParentID); try { con.Open(); nResult = cmd.ExecuteNonQuery(); } catch (SqlException ex) { throw new Exception(ex.Message, ex); } finally { con.Close(); } return nResult; }