日期:2014-05-17 浏览次数:20850 次
using (OracleCommand Cmd = new OracleCommand("QueryPagedTable", Conn)) { Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.Add("PageSize", OracleType.Int32).Value = PageSize; Cmd.Parameters.Add("PageNo", OracleType.Int32).Value = PageNo; Cmd.Parameters.Add("Table_", OracleType.VarChar, 50).Value = Table; Cmd.Parameters.Add("Filter", OracleType.VarChar, 1000).Value = Filter; Cmd.Parameters.Add("Order_", OracleType.VarChar, 500).Value = Order == null ? "" : Order; ; Cmd.Parameters["Order_"].Direction = ParameterDirection.Output; OracleDataAdapter ad = new OracleDataAdapter(Cmd); try { if (Conn.State != ConnectionState.Open) { Conn.Open(); OpenedHere = true; } ad.Fill(ds); } catch { return null; } finally { if (OpenedHere) if (Conn.State == ConnectionState.Open) Conn.Close(); } }