FCFL.NET Common Library - API Reference
ExecuteDataSet(IDbConnection,CommandType,String,DataParameterCollection) Method

A configured connection to the database
The CommandType to use when executing the commandText statement.
The text command to execute. The default value is an empty string ("").
A collection of parameters to use as replacements for the parameterized sections of the commandText
Executes the the specified parameterized SQL with the specified parameters using the provided database connection and returns the results as a DataSet
Syntax
'Declaration
 
Public Overloads Shared Function ExecuteDataSet( _
   ByVal connection As IDbConnection, _
   ByVal commandType As CommandType, _
   ByVal commandText As String, _
   ByVal commandParams As DataParameterCollection _
) As DataSet

Parameters

connection
A configured connection to the database
commandType
The CommandType to use when executing the commandText statement.
commandText
The text command to execute. The default value is an empty string ("").
commandParams
A collection of parameters to use as replacements for the parameterized sections of the commandText

Return Value

DataSet with zero or more DataTable objects each containing zero or more rows.
Remarks

The connection parameter is not required to be an open connection. If it is not open when passed to this method, it will be opened and will be closed when the method is finished. If it is passed in open, or live, it will remain open when this method completes.

The parameters in the commandParams parameter must be in the same ordinal number as the parameters specified in the commandText parameter. For example, if the "nameVal" parameter is to replace the {0} parameter in the commandText, it must be the first (zero position) parameter in the commandParams collection.

Not all providers return a DataSet with the same structure if no results are returned by the query. Some providers return an empty DataSet. Some providers return a DataSet with a single DataTable which contains zero rows. Test for tables and rows using the Count property on the DataSet and any DataTables before assuming any Tables or Rows exist. 

In no case will the DataSet returned be a null reference (Nothing in Visual Basic).

When the commandType parameter is set to StoredProcedure, set the commandText parameter to the name of the stored procedure. The user may be required to use escape character syntax if the stored procedure name contains any special characters. The command will call this stored procedure when you call one of the Execute methods.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Reference

SqlHelper Class
SqlHelper Members
Overload List

 

 


© 2010 Dovetail Software, Inc. - All rights reserved.
- Clarify, Amdocs, and related products and names are copyright and trademark of Amdocs, Inc.
- .NET, Visual Studio.NET, C#, Visual Basic and related products are trademark of Microsoft corporation.

Send comments on this topic.