【发布时间】:2014-03-23 03:38:23
【问题描述】:
我需要修改以下代码,限制行数。
// create the connection
OracleConnection conn = new OracleConnection("Data Source=oracledb;
User Id=UserID;Password=Password;");
// create the command for the stored procedure
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT_JOB_HISTORY.GetJobHistoryByEmployeeId";
cmd.CommandType = CommandType.StoredProcedure;
// add the parameters for the stored procedure including the REF CURSOR
// to retrieve the result set
cmd.Parameters.Add("p_employee_id", OracleType.Number).Value = 101;
cmd.Parameters.Add("cur_JobHistory", OracleType.Cursor).Direction =
ParameterDirection.Output;
// createt the DataAdapter from the command and use it to fill the
// DataSet
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);//Here is where I need to limit the rows
我知道有一种填充方法需要最大计数。
public int Fill( DataSet dataSet, int startRecord, int maxRecords, string srcTable )
但是,我不知道应该将什么传递给 srcTable。我的存储过程有一个 REF_CURSOR (OUT TYPES.REF_CURSOR)。
非常感谢任何帮助。
【问题讨论】:
标签: c# .net database dataset dataadapter