.NET Framework Class Library
Database.GetListFromQuery Method (String)
|
<< Click to Display Table of Contents >> Navigation: MwPDMApi Namespace > Database Class > Database Methods > GetListFromQuery Method > .NET Framework Class Library |
Given a query, returns a list of dynamic objects with the query results.
Namespace: MwPDMApi
Assembly: MwPDMApi (in MwPDMApi.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
Visual Basic |
|---|
Public Function GetListFromQuery ( _ query As String _ |
C# |
|---|
public List<Object> GetListFromQuery( string query |
Visual C++ |
|---|
public: List<Object^>^ GetListFromQuery( |
JavaScript |
|---|
function getListFromQuery(query); |
Parameters
query
Type: System.String
The query to execute. It must return a single recordset
Return Value
A list of objects whose property names are specified in the column name in the query
Remarks
Each object will have a property for each column in the query with the name of the column set in the query.
Examples
For example consider the following PowerShell piece of code:
|
|
|---|---|
$fn = $app.Messages().LookUp("NAME_FIELD_FILE_NAME") $fd = $app.Messages().LookUp("NAME_FIELD_FILE_DIRECTORY") $uid = $app.Messages().LookUp("NAME_FIELD_UNIQUE_ID") |
|
The $doc object in the foreach loop will have the properties FileName, Directory and QTY, which are exactly the column names specified in the query with the AS keyword.
We suggest to use the AS keyword to give a name to the columns in the query, to avoid difficulties with the localized databases.
See Also