Gemstone Data Library
Show/Hide TOC

# DataExtensionsRetrieveData(DbCommand, String, Object) Method

Executes the SQL statement using DbCommand, and returns the first DataTable of result set, if the result set contains multiple tables.

## Definition

Namespace: Gemstone.Data.DataExtensions
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.159 -- Release Build+9666939f99852a601f77d33e6f63320df255766c
C#
View Source Request Example

    public static DataTable RetrieveData(
    	this DbCommand command,
    	string sql,
    	params Object?[] parameters
    )

VB
View Source Request Example

    <ExtensionAttribute>
    Public Shared Function RetrieveData (
    	command As DbCommand,
    	sql As String,
    	ParamArray parameters As Object()
    ) As DataTable

C++
View Source Request Example

    public:
    [ExtensionAttribute]
    static DataTable^ RetrieveData(
    	DbCommand^ command,
    	String^ sql,
    	... array<Object^>^ parameters
    )

JavaScript
View Source Request Example

    Gemstone.Data.DataExtensions.DataExtensions.RetrieveData = function(command, sql, ... parameters);

#### Parameters

command DbCommand
  The DbCommand to use for executing the SQL statement.
sql String
  The SQL statement to be executed.
parameters Object
  The parameter values to be used to fill in DbParameter parameters identified by '@' prefix in sql expression.

#### Return Value

DataTable
A DataTable object.

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DbCommand. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

## See Also

#### Reference

DataExtensions Class
RetrieveData Overload
Gemstone.Data.DataExtensions Namespace