d, int maxRecords) { if (dataSet == null) { throw ADP.FillRequires("dataSet"); } if (ADP.IsEmpty(srcTable)) { throw ADP.FillRequiresSourceTableName("srcTable"); } if (dataReader == null) { throw ADP.FillRequires("dataReader"); } if (startRecord < 0) { throw ADP.InvalidStartRecord("startRecord", startRecord); } if (maxRecords < 0) { throw ADP.InvalidMaxRecords("maxRecords", maxRecords); } if (dataReader.IsClosed) { return 0; } return this.FillFromReader(dataSet, srcTable, dataReader, startRecord, maxRecords, null, null); } protected virtual int Fill(DataSet dataSet, int startRecord, int maxRecords, string srcTable, IDbCommand command, CommandBehavior behavior) { if (dataSet == null) { throw ADP.FillRequires("dataSet"); } if (command == null) { throw ADP.MissingSelectCommand("Fill"); } if (startRecord < 0) { throw ADP.InvalidStartRecord("startRecord", startRecord); } if (maxRecords < 0) { throw ADP.InvalidMaxRecords("maxRecords", maxRecords); } if (ADP.IsEmpty(srcTable)) { throw ADP.FillRequiresSourceTableName("srcTable"); } return this.FillFromCommand(dataSet, startRecord, maxRecords, srcTable, command, behavior); }
其实我们可以看到Fill方法调用了FillFromCommand或FillFromReader方法。这两个方法在下篇文章中在讨论。
上一页 [1] [2] [3] |