IRemoteQueryProvider

Overview

The IRemoteQueryProvider interface exposes several methods used by DA LINQ for getting appropriate DA SQL strings and executing DA LINQ expressions.

This interface supported by the RemoteTable class. In most of cases there is no need to use this class directly, but it is possible to use it manually, as shown in the following example:

var linq = from prod in DataAdapter.GetTable<Products>() 
       where prod.Name.Contains("HDD")
           select prod;
IRemoteQueryProvider provider = new RemoteTable<Products>(DataAdapter);
String sql = provider.GetQueryText(linq.Expression);
Console.WriteLine("sql: {0} ", sql);

IEnumerable products = (IEnumerable)provider.Execute(linq.Expression);
foreach (Products p in products) {
    Console.WriteLine("{0}\t{1}", p.Id, p.Name);
}

Output: sql: SELECT [t0].[GroupId], [t0].[Id], [t0].[Name], [t0].[Obsolete], [t0].[PCode], [t0].[Remarks], [t0].[VendorId], [t0].[Warranty] FROM [Products] AS [t0] WHERE ([t0].[Name] LIKE '%' + :p0 + '%')

d24ecb7d-9efe-412e-a2df-01146a5b5fde Portable HDD 500.0GB Seagate FreeAgent Desktop ST3... 22a8cd1c-b104-4b50-b332-04359b791b5d Portable HDD 120.0GB Seagate Momentus ST901203FGD1... a215bbb3-2a3c-45c5-b602-0546272454f8 HDD box external 3,5" SATA HDD Welland Xpress ME-7... 228742b2-4471-4ee8-b542-2373859fd356 HDD box external 3,5_ IDE SATA HDD Akasa AK-ENP2SA... 62f61647-ec05-4e91-b2b9-253d8e942310 Portable HDD 250.0GB Western Digital My Passport E... ...

Location

Implemented in

Properties


ElementType

 

property ElementType: Type read;

 

Type ElementType { get; }

 

Property ReadOnly ElementType As Type

Required Methods


Execute

 

method Execute(sql: String; paramNames: array of String; paramValues: array of Object; reader: Func<QueryResult, Object>): Object

 

Object Execute(String sql, String[] paramNames, Object[] paramValues, Func<QueryResult, Object> reader)

 

Function Execute(sql As String, paramNames As array of String, paramValues As array of Object, reader As Func<QueryResult, Object>) As Object

Parameters:

  • sql:
  • paramNames:
  • paramValues:
  • reader:

GetQueryText

Describes the method that returns the DA SQL query (as string) generated from the given DA LINQ expression.

 

method GetQueryText(anExpression: Expression): String

 

String GetQueryText(Expression anExpression)

 

Function GetQueryText(anExpression As Expression) As String

Parameters:

  • anExpression:

See Also