FillIntoExistingDataSet Method

Overview

The FillIntoExistingDataSet method synchronously executes a query and adds the returned tables into an existing POCO IDataSet.

Declarations

/// <summary>
/// Fills an existing data set by adding one or more result-set tables into it.
/// </summary>
public IDataSet FillIntoExistingDataSet(IDataSet dataSet, string baseQuery, bool isStoredProcedure, Dictionary<string, object?>? parameters, List<string>? returnedTableNames, string? connectionString)

/// <summary>
/// Fills an existing data set by adding one or more result-set tables into it using provider-specific SQL parameters.
/// </summary>
public IDataSet FillIntoExistingDataSet(IDataSet dataSet, string baseQuery, bool isStoredProcedure, params SqlParameter[] parameters)

Namespace and Assembly

Namespace: PocoDataSet.SqlServerDataAdapter
Assembly: PocoDataSet.SqlServerDataAdapter.dll

Usage Example

IDataSet dataSet = DataSetFactory.CreateDataSet();
SqlDataAdapter adapter = new SqlDataAdapter(connectionString);

adapter.FillIntoExistingDataSet(dataSet, "SELECT * FROM dbo.Department", false, (Dictionary<string, object?>?)null, null, null);

adapter.FillIntoExistingDataSet(dataSet, "SELECT * FROM dbo.Employee", false, (Dictionary<string, object?>?)null, null null);

bool hasDepartment = dataSet.Tables.ContainsKey("Department");
bool hasEmployee = dataSet.Tables.ContainsKey("Employee");

 

Table of Content POCO DataSet API References SqlDataAdapter Members

 


Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness or suitability of the information and are not responsible for any damages resulting from its use.