DGC.Data Programmer's Reference

IDal.GetProcedureDataSet Method (String, String)

Executes a stored procedure and populates a DataTable with the results set.

[Visual Basic]
Function GetProcedureDataSet( _
   ByVal storedProcedureName As String, _
   ByVal tableName As String _
) As DataSet
[C#]
DataSet GetProcedureDataSet(
   string storedProcedureName,
   string tableName
);

Parameters

storedProcedureName
The name of the stored procedure to execute.
tableName
The name of the DataTable to populate.

Return Value

An untyped DataSet object.

Remarks

A DataTable is created within a DataSet object and then populated with the data.

Example

The following example executes a stored procedure and populates an untyped DataTable.

[Visual Basic] 
    Dim d As DGC.Data.IDAL 
    Dim myDataSet As DataSet 

    d = DGC.Data.DALFactory.GetDAL(connectionString, databaseType) 

    myDataSet = d.GetProcedureDataSet("dbo.usp_getRelatedRecords", "myDataTable") 

See Also

IDal Interface | DGC.Data Namespace | IDal.GetProcedureDataSet Overload List