DGC.Data Programmer's Reference

IDal.GetProcedureDataSet Method (String, ArrayList, DataSet, String)

Executes a stored procedure using the supplied parameters and populates the supplied typed DataTable with the results set.

[Visual Basic]
Sub GetProcedureDataSet( _
   ByVal storedProcedureName As String, _
   ByVal parameters As ArrayList, _
   ByVal typedDataset As DataSet, _
   ByVal tableName As String _
)
[C#]
void GetProcedureDataSet(
   string storedProcedureName,
   ArrayList parameters,
   DataSet typedDataset,
   string tableName
);

Parameters

storedProcedureName
The name of the stored procedure to execute.
parameters
An ArrayList containing DALParameter objects.
typedDataset
A typed DataSet object.
tableName
The name of the typed DataTable to populate.

Remarks

Unlike the other versions of this method a typed DataSet containing at least one typed DataTable must be supplied to be populated with the data.

Example

The following example executes a stored procedure and populates a typed DataTable.

[Visual Basic] 
    Dim d As DGC.Data.IDAL 
    Dim myDataSet As New myTypedDataSet 
    Dim params as New ArrayList 

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

    params.Add(d.CreateParameter("@pId", ParameterTypes.DalInteger, ParameterDirections.DalInput, idToMatch) 

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

See Also

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