LinqLocalDataAdapter

Overview

The LinqLocalDataAdapter class allows to access Data Abstract service using DA LINQ within the server application itself. It provides all the logic for executing DA LINQ queries, applying changes (Deltas) back to the database server and handling any other data-related communications, such as retrieving Business Rules Scripting API or schema information.

Contrary to the LinqRemoteDataAdapter class the LinqLocalDataAdapter can access only local (ie hosted by the same application) data services. The usage of LinqLocalDataAdapter class is similar to the usage of the LinqRemoteDataAdapter class.

You can find more detailed information about how DA LINQ works in the article DA LINQ in Depth (.NET).

Location

 

constructor

Creates a new instance of the LinqLocalDataAdapter class.

 

constructor

 

LinqLocalDataAdapter()

 

Sub New

constructor (Boolean)  protected    (declared in LinqDataAdapter)

 

constructor(avoidLicenseCheck: Boolean)

 

LinqLocalDataAdapter(Boolean avoidLicenseCheck)

 

Sub New (avoidLicenseCheck As Boolean)

Parameters:

  • avoidLicenseCheck:

Creates a new instance of the LinqLocalDataAdapter class and initializes its ServiceInstance property.

 

constructor(serviceInstance: IDataAbstractLocalServiceAccess)

 

LinqLocalDataAdapter(IDataAbstractLocalServiceAccess serviceInstance)

 

Sub New (serviceInstance As IDataAbstractLocalServiceAccess)

Parameters:

  • serviceInstance: Data service instance

constructor (IDataAbstractLocalServiceAccess, Guid)

 

constructor(serviceInstance: IDataAbstractLocalServiceAccess; sessionId: Guid)

 

LinqLocalDataAdapter(IDataAbstractLocalServiceAccess serviceInstance, Guid sessionId)

 

Sub New (serviceInstance As IDataAbstractLocalServiceAccess, sessionId As Guid)

Parameters:

  • serviceInstance:
  • sessionId:

constructor (String)

Creates a new instance of the LinqLocalDataAdapter class and sets its ServiceName property.

 

constructor(serviceName: String)

 

LinqLocalDataAdapter(String serviceName)

 

Sub New (serviceName As String)

Parameters:

  • serviceName: Name of the data service that will be used to access the data

constructor (String, Guid)

Creates a new instance of the LinqLocalDataAdapter class and sets its ServiceName and SessionID properties.

 

constructor(serviceName: String; sessionId: Guid)

 

LinqLocalDataAdapter(String serviceName, Guid sessionId)

 

Sub New (serviceName As String, sessionId As Guid)

Parameters:

  • serviceName: Name of the data service that will be used to access the data
  • sessionId: Session ID that will be used by the data service to access the data

constructor (IContainer)

Creates a new instance of the LinqLocalDataAdapter class and adds it to the component container.

 

constructor(container: IContainer)

 

LinqLocalDataAdapter(IContainer container)

 

Sub New (container As IContainer)

Parameters:

  • container: Container that will contain the newly created LinqLocalDataAdapter instance

AcceptChangesDuringFill    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.

The default value is true.

 

property AcceptChangesDuringFill: Boolean read write;

 

Boolean AcceptChangesDuringFill { get; set; }

 

Property AcceptChangesDuringFill As Boolean

AcceptChangesDuringUpdate    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.

The default value is true.

 

property AcceptChangesDuringUpdate: Boolean read write;

 

Boolean AcceptChangesDuringUpdate { get; set; }

 

Property AcceptChangesDuringUpdate As Boolean

add_OnApplyChanges    (declared in LinqDataAdapter)

 

method add_OnApplyChanges(value: EventHandler)

 

void add_OnApplyChanges(EventHandler value)

 

Sub add_OnApplyChanges(value As EventHandler)

Parameters:

  • value:

ApplyChanges    (declared in LinqDataAdapter)

Applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method ApplyChanges

 

void ApplyChanges()

 

Sub ApplyChanges

AutoLoadScripts    (declared in BaseDataAdapter)

Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.

 

property AutoLoadScripts: Boolean read write;

 

Boolean AutoLoadScripts { get; set; }

 

Property AutoLoadScripts As Boolean

BeginApplyChanges    (declared in LinqDataAdapter)

Asyncronously applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method BeginApplyChanges(cb: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginApplyChanges(AsyncCallback cb, Object state)

 

Function BeginApplyChanges(cb As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • cb: Callback method that will be called once the update process is done.
  • state: State information about the asynchronous operation.

BeginExecute    (declared in LinqDataAdapter)

Asynchronously executes the provided queries. Basically, this is the only way to execute a DA Linq query in a Silverlight application.

This code sample demonstrates how data is retrieved in a Silverlight application (code snippet from the Silverlight sample shipped with DataAbstract for .NET):

var q = (from x in linqRemoteDataAdapter.GetTable<Products>() select x);
IQueryable[] Queries = new IQueryable[] { q };
linqRemoteDataAdapter.BeginExecute(
    Queries,
    delegate(IAsyncResult ar)
    {
        linqRemoteDataAdapter.EndExecute(ar);
        Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), q.ToList<Products>());
    },
    null);

 

method BeginExecute(query: array of IQueryable; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginExecute(IQueryable[] query, AsyncCallback callback, Object state)

 

Function BeginExecute(query As array of IQueryable, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • query: Array of IQueryable objects representing DA Linq queries.
  • callback:
  • state: State information about the asynchronous operation.

BeginFetchData  protected

 

method BeginFetchData(request: array of TableRequestInfo; names: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginFetchData(TableRequestInfo[] request, String[] names, Action<Int32, Int32[], IDataReader> fillMethod, AsyncCallback callback, Object state)

 

Function BeginFetchData(request As array of TableRequestInfo, names As array of String, fillMethod As Action<Int32, array of Int32, IDataReader>, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • request:
  • names:
  • fillMethod:
  • callback:
  • state:

BeginInit    (declared in BaseDataAdapter)

 

method BeginInit

 

void BeginInit()

 

Sub BeginInit

BeginInternalUpdate (array of Delta, AsyncCallback, Object): IAsyncResult  protected    (declared in BaseDataAdapter)

Starts asynchronous data update operation.

 

method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)

 

Function BeginInternalUpdate(deltas As array of Delta, cb As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • deltas: Collection of Delta instances that will be send to the Data Abstract server
  • cb: Callback method that will be called once the asynchronous data update call is completed
  • state: Asynchronous operation state object

BeginInternalUpdate (array of Delta, AsyncCallback, Object): IAsyncResult  protected

Starts asynchronous data update call.

 

method BeginInternalUpdate(deltas: array of Delta; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback callback, Object state)

 

Function BeginInternalUpdate(deltas As array of Delta, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • deltas: List of Deltas containing data update information
  • callback: Method that will be called once the opration completes
  • state: Asynchronous operation state object

CacheSchema    (declared in BaseDataAdapter)

Gets or sets flag indicating whether Schema retrieved from the server via the BaseDataAdapter method call should be chached in the BaseDataAdapter property. Setting this property to false can significantly decrease performance.

The default value is true.

 

property CacheSchema: Boolean read write;

 

Boolean CacheSchema { get; set; }

 

Property CacheSchema As Boolean

CancelChanges    (declared in LinqDataAdapter)

Clears changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method CancelChanges

 

void CancelChanges()

 

Sub CancelChanges

CheckAdapterSettings  protected

Performs required internal data adapter initialization before issuing a data read or update request.

 

method CheckAdapterSettings

 

void CheckAdapterSettings()

 

Sub CheckAdapterSettings

CheckFailures  protected    (declared in BaseDataAdapter)

Composes the data update failure message based on the Delta information returned from the server after the Udate call.

 

method CheckFailures(delta: Delta; changes: List<DeltaChange>; failureMessage: StringBuilder)

 

void CheckFailures(Delta delta, List<DeltaChange> changes, StringBuilder failureMessage)

 

Sub CheckFailures(delta As Delta, changes As List<DeltaChange>, failureMessage As StringBuilder)

Parameters:

  • delta: Delta instance returned from the Data Abstract server
  • changes: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
  • failureMessage: String builder instace that will contain composed data update failure message

ClearAsyncResults    (declared in LinqDataAdapter)

 

method ClearAsyncResults

 

void ClearAsyncResults()

 

Sub ClearAsyncResults

CloneTable<T>    (declared in LinqDataAdapter)

 

method CloneTable<T>(source: T): T

 

T CloneTable<T>(T source)

 

Function CloneTable<T>(source As T) As T

Parameters:

  • source:

CompareBytes    (declared in LinqDataAdapter)

 

class method CompareBytes(a: array of Byte; b: array of Byte): Boolean

 

static Boolean CompareBytes(Byte[] a, Byte[] b)

 

Shared Function CompareBytes(a As array of Byte, b As array of Byte) As Boolean

Parameters:

  • a:
  • b:

DeleteRow<T>    (declared in LinqDataAdapter)

 

method DeleteRow<T>(data: T): DeltaChange

 

DeltaChange DeleteRow<T>(T data)

 

Function DeleteRow<T>(data As T) As DeltaChange

Parameters:

  • data:

Dispose  protected

Releases the unmanaged resources used by the current LinqLocalDataAdapter instance and its child controls and optionally releases the managed resources.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing: Flag indicating whether both both managed and unmanaged resources should be released (true; or only unmanaged resources should be released (false)

DynamicSelect    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature

 

property DynamicSelect: Boolean read write;

 

Boolean DynamicSelect { get; set; }

 

Property DynamicSelect As Boolean

EndApplyChanges    (declared in LinqDataAdapter)

Ends an asynchronous remote database update.

 

method EndApplyChanges(ar: IAsyncResult)

 

void EndApplyChanges(IAsyncResult ar)

 

Sub EndApplyChanges(ar As IAsyncResult)

Parameters:

  • ar: The pending asynchronous data update operation.

EndExecute    (declared in LinqDataAdapter)

Ends an asynchronous query request to a data service.

 

method EndExecute(ar: IAsyncResult)

 

void EndExecute(IAsyncResult ar)

 

Sub EndExecute(ar As IAsyncResult)

Parameters:

  • ar: The pending asynchronous query request.

EndFetchData  protected

 

method EndFetchData(ar: IAsyncResult)

 

void EndFetchData(IAsyncResult ar)

 

Sub EndFetchData(ar As IAsyncResult)

Parameters:

  • ar:

EndInit    (declared in BaseDataAdapter)

 

method EndInit

 

void EndInit()

 

Sub EndInit

EndInternalUpdate  protected

This method is called once the asynchronous update operation is completed.

 

method EndInternalUpdate(ar: IAsyncResult)

 

void EndInternalUpdate(IAsyncResult ar)

 

Sub EndInternalUpdate(ar As IAsyncResult)

Parameters:

  • ar: Status of the asynchronous operation

EnterCriticalSection  protected    (declared in BaseDataAdapter)

 

method EnterCriticalSection(status: DataAdapterStatus)

 

void EnterCriticalSection(DataAdapterStatus status)

 

Sub EnterCriticalSection(status As DataAdapterStatus)

Parameters:

  • status:

Execute    (declared in LinqDataAdapter)

 

method Execute(query: array of IQueryable): array of Object

 

Object[] Execute(IQueryable[] query)

 

Function Execute(query As array of IQueryable) As array of Object

Parameters:

  • query:

ExitCriticalSection  protected    (declared in BaseDataAdapter)

This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.

This method sets the BaseDataAdapter property to RemoteAdapterStatus.Idle and then releases the critical code section lock.

 

method ExitCriticalSection

 

void ExitCriticalSection()

 

Sub ExitCriticalSection

FailureBehavior    (declared in BaseDataAdapter)

Gets or sets intended Data Adapter behavior on data update errors.

 

property FailureBehavior: FailureBehavior read write;

 

FailureBehavior FailureBehavior { get; set; }

 

Property FailureBehavior As FailureBehavior

FetchData  protected

 

method FetchData(requests: array of TableRequestInfo; names: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>)

 

void FetchData(TableRequestInfo[] requests, String[] names, Action<Int32, Int32[], IDataReader> fillMethod)

 

Sub FetchData(requests As array of TableRequestInfo, names As array of String, fillMethod As Action<Int32, array of Int32, IDataReader>)

Parameters:

  • requests:
  • names:
  • fillMethod:

FlushSchema    (declared in BaseDataAdapter)

Cleans up the Schema cache and sets the BaseDataAdapter to null.

 

method FlushSchema

 

void FlushSchema()

 

Sub FlushSchema

GetPendingDeltas  protected    (declared in LinqDataAdapter)

 

method GetPendingDeltas: array of Delta

 

Delta[] GetPendingDeltas()

 

Function GetPendingDeltas As array of Delta

GetSchemaOnFirstFill    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.

The default value is true.

 

property GetSchemaOnFirstFill: Boolean read write;

 

Boolean GetSchemaOnFirstFill { get; set; }

 

Property GetSchemaOnFirstFill As Boolean

GetTable<T>    (declared in LinqDataAdapter)

 

method GetTable<T>: RemoteTable<T>

 

RemoteTable<T> GetTable<T>()

 

Function GetTable<T> As RemoteTable<T>

GetTable<T> (array of DataParameter): RemoteTableQuery<T>    (declared in LinqDataAdapter)

 

method GetTable<T>(parameters: array of DataParameter): RemoteTableQuery<T>

 

RemoteTableQuery<T> GetTable<T>(DataParameter[] parameters)

 

Function GetTable<T>(parameters As array of DataParameter) As RemoteTableQuery<T>

Parameters:

  • parameters:

InitScriptProvider    (declared in LinqDataAdapter)

 

method InitScriptProvider: Boolean

 

Boolean InitScriptProvider()

 

Function InitScriptProvider As Boolean

InsertRow<T>    (declared in LinqDataAdapter)

 

method InsertRow<T>(data: T): DeltaChange

 

DeltaChange InsertRow<T>(T data)

 

Function InsertRow<T>(data As T) As DeltaChange

Parameters:

  • data:

LoadScripts    (declared in BaseDataAdapter)

Downloads Business Rules Scripting API scripts from the server.

In its current implementation this method downloads entire Schema from the Data Abstract server.

 

method LoadScripts

 

void LoadScripts()

 

Sub LoadScripts

NewRow<T>    (declared in LinqDataAdapter)

 

method NewRow<T>: T

 

T NewRow<T>()

 

Function NewRow<T> As T

OnApplyChanges    (declared in LinqDataAdapter)

This event is fired before any data changes are sent to the DataAbstract server. It can be used to perform data validation, changes logging, etc.

 

event OnApplyChanges: EventHandler;

 

delegate EventHandler OnApplyChanges()

 

Event OnApplyChanges As EventHandler

ProcessPendingChangeDeltas  protected    (declared in LinqDataAdapter)

 

method ProcessPendingChangeDeltas(serverDeltas: array of Delta; originalDeltaChangeIds: IDictionary<String, array of Int32>)

 

void ProcessPendingChangeDeltas(Delta[] serverDeltas, IDictionary<String, Int32[]> originalDeltaChangeIds)

 

Sub ProcessPendingChangeDeltas(serverDeltas As array of Delta, originalDeltaChangeIds As IDictionary<String, array of Int32>)

Parameters:

  • serverDeltas:
  • originalDeltaChangeIds:

ReadSchema

 

method ReadSchema(forceRefresh: Boolean): Schema

 

Schema ReadSchema(Boolean forceRefresh)

 

Function ReadSchema(forceRefresh As Boolean) As Schema

Parameters:

  • forceRefresh:

ReadStreamerSchema  protected

Downloads the Schema from the data service as binary stream.

 

method ReadStreamerSchema: Binary

 

Binary ReadStreamerSchema()

 

Function ReadStreamerSchema As Binary

remove_OnApplyChanges    (declared in LinqDataAdapter)

 

method remove_OnApplyChanges(value: EventHandler)

 

void remove_OnApplyChanges(EventHandler value)

 

Sub remove_OnApplyChanges(value As EventHandler)

Parameters:

  • value:

RemoveAsyncResult    (declared in LinqDataAdapter)

 

method RemoveAsyncResult(query: IQueryable)

 

void RemoveAsyncResult(IQueryable query)

 

Sub RemoveAsyncResult(query As IQueryable)

Parameters:

  • query:

Schema    (declared in BaseDataAdapter)

Gets the Schema currently cached by the Data Adapter instance

 

property Schema: Schema read;

 

Schema Schema { get; }

 

Property ReadOnly Schema As Schema

ScriptProvider    (declared in BaseDataAdapter)

Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.

 

property ScriptProvider: IScriptProvider read write;

 

IScriptProvider ScriptProvider { get; set; }

 

Property ScriptProvider As IScriptProvider

ServiceInstance

Gets or sets the instance of the data service used to retrieve and update data.

 

property ServiceInstance: IDataAbstractLocalServiceAccess read write;

 

IDataAbstractLocalServiceAccess ServiceInstance { get; set; }

 

Property ServiceInstance As IDataAbstractLocalServiceAccess

ServiceName

Gets or sets the name of the data service that will be used to retrieve and update data.

 

property ServiceName: String read write;

 

String ServiceName { get; set; }

 

Property ServiceName As String

SessionID

Gets or sets the session ID that is used to retrieve or update data. This allows to impersonate user when the data service requires authentication.

 

property SessionID: Guid read write;

 

Guid SessionID { get; set; }

 

Property SessionID As Guid

Status    (declared in BaseDataAdapter)

Gets current status of the Data Adapter

 

property Status: DataAdapterStatus read;

 

DataAdapterStatus Status { get; }

 

Property ReadOnly Status As DataAdapterStatus

ThrowFailures  protected    (declared in LinqDataAdapter)

This method is called at the end of the ApplyChanges method. It throws a DAUpdatesFailedException if the provided aChanges list is not empty (which means that some DeltaChanges were not processed successfully) and the FailureBehavior property is set to FailureBehavior.RaiseException or FailureBehavior.Both.

 

method ThrowFailures(changes: List<DeltaChange>; failureMessage: String)

 

void ThrowFailures(List<DeltaChange> changes, String failureMessage)

 

Sub ThrowFailures(changes As List<DeltaChange>, failureMessage As String)

Parameters:

  • changes:
  • failureMessage:

TriggerApplyChanges  protected    (declared in LinqDataAdapter)

 

method TriggerApplyChanges

 

void TriggerApplyChanges()

 

Sub TriggerApplyChanges

UpdateRow<T> (T): DeltaChange    (declared in LinqDataAdapter)

 

method UpdateRow<T>(data: T): DeltaChange

 

DeltaChange UpdateRow<T>(T data)

 

Function UpdateRow<T>(data As T) As DeltaChange

Parameters:

  • data:

UpdateRow<T> (T, T): DeltaChange    (declared in LinqDataAdapter)

 

method UpdateRow<T>(originalData: T; newData: T): DeltaChange

 

DeltaChange UpdateRow<T>(T originalData, T newData)

 

Function UpdateRow<T>(originalData As T, newData As T) As DeltaChange

Parameters:

  • originalData:
  • newData:

UseBindableClass    (declared in LinqDataAdapter)

Defines which type will be used as the base type for query result representation: the ordinary System.Collections.Generic.List class (which will be used if this property is set to false) or the more advanced DABindingList class.

The default value of this property is true.

Yuo can set this property to false if you just want to retrieve data, but do not need the advanced binding capabilities of the DABindingList class.

 

property UseBindableClass: Boolean read write;

 

Boolean UseBindableClass { get; set; }

 

Property UseBindableClass As Boolean

UseDynamicWhere    (declared in LinqDataAdapter)

Defines how the data will be retrieved from the DataAbstract server. If this property is set to true, Dynamic Where will be used. If set to false, the more advanced DA SQL approach will be used (note that this approach is not compatible with Delphi-based DataAbstract servers).

The default value of this property is true for assemblies for the full .NET and the .NET Compact Frameworks, false for the Silverlight version of DataAbstract for .NET.

Note: If your client application is intended to be used only with .NET-based Data Abstract servers, the recommended value of this property is false, because some Linq operators cannot be represented with Dynamic Where conditions.

 

property UseDynamicWhere: Boolean read write;

 

Boolean UseDynamicWhere { get; set; }

 

Property UseDynamicWhere As Boolean

 

AcceptChangesDuringFill    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.

The default value is true.

 

property AcceptChangesDuringFill: Boolean read write;

 

Boolean AcceptChangesDuringFill { get; set; }

 

Property AcceptChangesDuringFill As Boolean

AcceptChangesDuringUpdate    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.

The default value is true.

 

property AcceptChangesDuringUpdate: Boolean read write;

 

Boolean AcceptChangesDuringUpdate { get; set; }

 

Property AcceptChangesDuringUpdate As Boolean

AutoLoadScripts    (declared in BaseDataAdapter)

Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.

 

property AutoLoadScripts: Boolean read write;

 

Boolean AutoLoadScripts { get; set; }

 

Property AutoLoadScripts As Boolean

CacheSchema    (declared in BaseDataAdapter)

Gets or sets flag indicating whether Schema retrieved from the server via the BaseDataAdapter method call should be chached in the BaseDataAdapter property. Setting this property to false can significantly decrease performance.

The default value is true.

 

property CacheSchema: Boolean read write;

 

Boolean CacheSchema { get; set; }

 

Property CacheSchema As Boolean

DynamicSelect    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature

 

property DynamicSelect: Boolean read write;

 

Boolean DynamicSelect { get; set; }

 

Property DynamicSelect As Boolean

FailureBehavior    (declared in BaseDataAdapter)

Gets or sets intended Data Adapter behavior on data update errors.

 

property FailureBehavior: FailureBehavior read write;

 

FailureBehavior FailureBehavior { get; set; }

 

Property FailureBehavior As FailureBehavior

GetSchemaOnFirstFill    (declared in BaseDataAdapter)

Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.

The default value is true.

 

property GetSchemaOnFirstFill: Boolean read write;

 

Boolean GetSchemaOnFirstFill { get; set; }

 

Property GetSchemaOnFirstFill As Boolean

Schema    (declared in BaseDataAdapter)

Gets the Schema currently cached by the Data Adapter instance

 

property Schema: Schema read;

 

Schema Schema { get; }

 

Property ReadOnly Schema As Schema

ScriptProvider    (declared in BaseDataAdapter)

Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.

 

property ScriptProvider: IScriptProvider read write;

 

IScriptProvider ScriptProvider { get; set; }

 

Property ScriptProvider As IScriptProvider

ServiceInstance

Gets or sets the instance of the data service used to retrieve and update data.

 

property ServiceInstance: IDataAbstractLocalServiceAccess read write;

 

IDataAbstractLocalServiceAccess ServiceInstance { get; set; }

 

Property ServiceInstance As IDataAbstractLocalServiceAccess

ServiceName

Gets or sets the name of the data service that will be used to retrieve and update data.

 

property ServiceName: String read write;

 

String ServiceName { get; set; }

 

Property ServiceName As String

SessionID

Gets or sets the session ID that is used to retrieve or update data. This allows to impersonate user when the data service requires authentication.

 

property SessionID: Guid read write;

 

Guid SessionID { get; set; }

 

Property SessionID As Guid

Status    (declared in BaseDataAdapter)

Gets current status of the Data Adapter

 

property Status: DataAdapterStatus read;

 

DataAdapterStatus Status { get; }

 

Property ReadOnly Status As DataAdapterStatus

UseBindableClass    (declared in LinqDataAdapter)

Defines which type will be used as the base type for query result representation: the ordinary System.Collections.Generic.List class (which will be used if this property is set to false) or the more advanced DABindingList class.

The default value of this property is true.

Yuo can set this property to false if you just want to retrieve data, but do not need the advanced binding capabilities of the DABindingList class.

 

property UseBindableClass: Boolean read write;

 

Boolean UseBindableClass { get; set; }

 

Property UseBindableClass As Boolean

UseDynamicWhere    (declared in LinqDataAdapter)

Defines how the data will be retrieved from the DataAbstract server. If this property is set to true, Dynamic Where will be used. If set to false, the more advanced DA SQL approach will be used (note that this approach is not compatible with Delphi-based DataAbstract servers).

The default value of this property is true for assemblies for the full .NET and the .NET Compact Frameworks, false for the Silverlight version of DataAbstract for .NET.

Note: If your client application is intended to be used only with .NET-based Data Abstract servers, the recommended value of this property is false, because some Linq operators cannot be represented with Dynamic Where conditions.

 

property UseDynamicWhere: Boolean read write;

 

Boolean UseDynamicWhere { get; set; }

 

Property UseDynamicWhere As Boolean

 

CompareBytes    (declared in LinqDataAdapter)

 

class method CompareBytes(a: array of Byte; b: array of Byte): Boolean

 

static Boolean CompareBytes(Byte[] a, Byte[] b)

 

Shared Function CompareBytes(a As array of Byte, b As array of Byte) As Boolean

Parameters:

  • a:
  • b:

 

constructor

Creates a new instance of the LinqLocalDataAdapter class.

 

constructor

 

LinqLocalDataAdapter()

 

Sub New

constructor (Boolean)  protected    (declared in LinqDataAdapter)

 

constructor(avoidLicenseCheck: Boolean)

 

LinqLocalDataAdapter(Boolean avoidLicenseCheck)

 

Sub New (avoidLicenseCheck As Boolean)

Parameters:

  • avoidLicenseCheck:

Creates a new instance of the LinqLocalDataAdapter class and initializes its ServiceInstance property.

 

constructor(serviceInstance: IDataAbstractLocalServiceAccess)

 

LinqLocalDataAdapter(IDataAbstractLocalServiceAccess serviceInstance)

 

Sub New (serviceInstance As IDataAbstractLocalServiceAccess)

Parameters:

  • serviceInstance: Data service instance

constructor (IDataAbstractLocalServiceAccess, Guid)

 

constructor(serviceInstance: IDataAbstractLocalServiceAccess; sessionId: Guid)

 

LinqLocalDataAdapter(IDataAbstractLocalServiceAccess serviceInstance, Guid sessionId)

 

Sub New (serviceInstance As IDataAbstractLocalServiceAccess, sessionId As Guid)

Parameters:

  • serviceInstance:
  • sessionId:

constructor (String)

Creates a new instance of the LinqLocalDataAdapter class and sets its ServiceName property.

 

constructor(serviceName: String)

 

LinqLocalDataAdapter(String serviceName)

 

Sub New (serviceName As String)

Parameters:

  • serviceName: Name of the data service that will be used to access the data

constructor (String, Guid)

Creates a new instance of the LinqLocalDataAdapter class and sets its ServiceName and SessionID properties.

 

constructor(serviceName: String; sessionId: Guid)

 

LinqLocalDataAdapter(String serviceName, Guid sessionId)

 

Sub New (serviceName As String, sessionId As Guid)

Parameters:

  • serviceName: Name of the data service that will be used to access the data
  • sessionId: Session ID that will be used by the data service to access the data

constructor (IContainer)

Creates a new instance of the LinqLocalDataAdapter class and adds it to the component container.

 

constructor(container: IContainer)

 

LinqLocalDataAdapter(IContainer container)

 

Sub New (container As IContainer)

Parameters:

  • container: Container that will contain the newly created LinqLocalDataAdapter instance

add_OnApplyChanges    (declared in LinqDataAdapter)

 

method add_OnApplyChanges(value: EventHandler)

 

void add_OnApplyChanges(EventHandler value)

 

Sub add_OnApplyChanges(value As EventHandler)

Parameters:

  • value:

ApplyChanges    (declared in LinqDataAdapter)

Applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method ApplyChanges

 

void ApplyChanges()

 

Sub ApplyChanges

BeginApplyChanges    (declared in LinqDataAdapter)

Asyncronously applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method BeginApplyChanges(cb: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginApplyChanges(AsyncCallback cb, Object state)

 

Function BeginApplyChanges(cb As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • cb: Callback method that will be called once the update process is done.
  • state: State information about the asynchronous operation.

BeginExecute    (declared in LinqDataAdapter)

Asynchronously executes the provided queries. Basically, this is the only way to execute a DA Linq query in a Silverlight application.

This code sample demonstrates how data is retrieved in a Silverlight application (code snippet from the Silverlight sample shipped with DataAbstract for .NET):

var q = (from x in linqRemoteDataAdapter.GetTable<Products>() select x);
IQueryable[] Queries = new IQueryable[] { q };
linqRemoteDataAdapter.BeginExecute(
    Queries,
    delegate(IAsyncResult ar)
    {
        linqRemoteDataAdapter.EndExecute(ar);
        Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), q.ToList<Products>());
    },
    null);

 

method BeginExecute(query: array of IQueryable; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginExecute(IQueryable[] query, AsyncCallback callback, Object state)

 

Function BeginExecute(query As array of IQueryable, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • query: Array of IQueryable objects representing DA Linq queries.
  • callback:
  • state: State information about the asynchronous operation.

BeginFetchData  protected

 

method BeginFetchData(request: array of TableRequestInfo; names: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginFetchData(TableRequestInfo[] request, String[] names, Action<Int32, Int32[], IDataReader> fillMethod, AsyncCallback callback, Object state)

 

Function BeginFetchData(request As array of TableRequestInfo, names As array of String, fillMethod As Action<Int32, array of Int32, IDataReader>, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • request:
  • names:
  • fillMethod:
  • callback:
  • state:

BeginInit    (declared in BaseDataAdapter)

 

method BeginInit

 

void BeginInit()

 

Sub BeginInit

BeginInternalUpdate (array of Delta, AsyncCallback, Object): IAsyncResult  protected    (declared in BaseDataAdapter)

Starts asynchronous data update operation.

 

method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)

 

Function BeginInternalUpdate(deltas As array of Delta, cb As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • deltas: Collection of Delta instances that will be send to the Data Abstract server
  • cb: Callback method that will be called once the asynchronous data update call is completed
  • state: Asynchronous operation state object

BeginInternalUpdate (array of Delta, AsyncCallback, Object): IAsyncResult  protected

Starts asynchronous data update call.

 

method BeginInternalUpdate(deltas: array of Delta; callback: AsyncCallback; state: Object): IAsyncResult

 

IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback callback, Object state)

 

Function BeginInternalUpdate(deltas As array of Delta, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters:

  • deltas: List of Deltas containing data update information
  • callback: Method that will be called once the opration completes
  • state: Asynchronous operation state object

CancelChanges    (declared in LinqDataAdapter)

Clears changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.

 

method CancelChanges

 

void CancelChanges()

 

Sub CancelChanges

CheckAdapterSettings  protected

Performs required internal data adapter initialization before issuing a data read or update request.

 

method CheckAdapterSettings

 

void CheckAdapterSettings()

 

Sub CheckAdapterSettings

CheckFailures  protected    (declared in BaseDataAdapter)

Composes the data update failure message based on the Delta information returned from the server after the Udate call.

 

method CheckFailures(delta: Delta; changes: List<DeltaChange>; failureMessage: StringBuilder)

 

void CheckFailures(Delta delta, List<DeltaChange> changes, StringBuilder failureMessage)

 

Sub CheckFailures(delta As Delta, changes As List<DeltaChange>, failureMessage As StringBuilder)

Parameters:

  • delta: Delta instance returned from the Data Abstract server
  • changes: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
  • failureMessage: String builder instace that will contain composed data update failure message

ClearAsyncResults    (declared in LinqDataAdapter)

 

method ClearAsyncResults

 

void ClearAsyncResults()

 

Sub ClearAsyncResults

CloneTable<T>    (declared in LinqDataAdapter)

 

method CloneTable<T>(source: T): T

 

T CloneTable<T>(T source)

 

Function CloneTable<T>(source As T) As T

Parameters:

  • source:

DeleteRow<T>    (declared in LinqDataAdapter)

 

method DeleteRow<T>(data: T): DeltaChange

 

DeltaChange DeleteRow<T>(T data)

 

Function DeleteRow<T>(data As T) As DeltaChange

Parameters:

  • data:

Dispose  protected

Releases the unmanaged resources used by the current LinqLocalDataAdapter instance and its child controls and optionally releases the managed resources.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing: Flag indicating whether both both managed and unmanaged resources should be released (true; or only unmanaged resources should be released (false)

EndApplyChanges    (declared in LinqDataAdapter)

Ends an asynchronous remote database update.

 

method EndApplyChanges(ar: IAsyncResult)

 

void EndApplyChanges(IAsyncResult ar)

 

Sub EndApplyChanges(ar As IAsyncResult)

Parameters:

  • ar: The pending asynchronous data update operation.

EndExecute    (declared in LinqDataAdapter)

Ends an asynchronous query request to a data service.

 

method EndExecute(ar: IAsyncResult)

 

void EndExecute(IAsyncResult ar)

 

Sub EndExecute(ar As IAsyncResult)

Parameters:

  • ar: The pending asynchronous query request.

EndFetchData  protected

 

method EndFetchData(ar: IAsyncResult)

 

void EndFetchData(IAsyncResult ar)

 

Sub EndFetchData(ar As IAsyncResult)

Parameters:

  • ar:

EndInit    (declared in BaseDataAdapter)

 

method EndInit

 

void EndInit()

 

Sub EndInit

EndInternalUpdate  protected

This method is called once the asynchronous update operation is completed.

 

method EndInternalUpdate(ar: IAsyncResult)

 

void EndInternalUpdate(IAsyncResult ar)

 

Sub EndInternalUpdate(ar As IAsyncResult)

Parameters:

  • ar: Status of the asynchronous operation

EnterCriticalSection  protected    (declared in BaseDataAdapter)

 

method EnterCriticalSection(status: DataAdapterStatus)

 

void EnterCriticalSection(DataAdapterStatus status)

 

Sub EnterCriticalSection(status As DataAdapterStatus)

Parameters:

  • status:

Execute    (declared in LinqDataAdapter)

 

method Execute(query: array of IQueryable): array of Object

 

Object[] Execute(IQueryable[] query)

 

Function Execute(query As array of IQueryable) As array of Object

Parameters:

  • query:

ExitCriticalSection  protected    (declared in BaseDataAdapter)

This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.

This method sets the BaseDataAdapter property to RemoteAdapterStatus.Idle and then releases the critical code section lock.

 

method ExitCriticalSection

 

void ExitCriticalSection()

 

Sub ExitCriticalSection

FetchData  protected

 

method FetchData(requests: array of TableRequestInfo; names: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>)

 

void FetchData(TableRequestInfo[] requests, String[] names, Action<Int32, Int32[], IDataReader> fillMethod)

 

Sub FetchData(requests As array of TableRequestInfo, names As array of String, fillMethod As Action<Int32, array of Int32, IDataReader>)

Parameters:

  • requests:
  • names:
  • fillMethod:

FlushSchema    (declared in BaseDataAdapter)

Cleans up the Schema cache and sets the BaseDataAdapter to null.

 

method FlushSchema

 

void FlushSchema()

 

Sub FlushSchema

GetPendingDeltas  protected    (declared in LinqDataAdapter)

 

method GetPendingDeltas: array of Delta

 

Delta[] GetPendingDeltas()

 

Function GetPendingDeltas As array of Delta

GetTable<T>    (declared in LinqDataAdapter)

 

method GetTable<T>: RemoteTable<T>

 

RemoteTable<T> GetTable<T>()

 

Function GetTable<T> As RemoteTable<T>

GetTable<T> (array of DataParameter): RemoteTableQuery<T>    (declared in LinqDataAdapter)

 

method GetTable<T>(parameters: array of DataParameter): RemoteTableQuery<T>

 

RemoteTableQuery<T> GetTable<T>(DataParameter[] parameters)

 

Function GetTable<T>(parameters As array of DataParameter) As RemoteTableQuery<T>

Parameters:

  • parameters:

InitScriptProvider    (declared in LinqDataAdapter)

 

method InitScriptProvider: Boolean

 

Boolean InitScriptProvider()

 

Function InitScriptProvider As Boolean

InsertRow<T>    (declared in LinqDataAdapter)

 

method InsertRow<T>(data: T): DeltaChange

 

DeltaChange InsertRow<T>(T data)

 

Function InsertRow<T>(data As T) As DeltaChange

Parameters:

  • data:

LoadScripts    (declared in BaseDataAdapter)

Downloads Business Rules Scripting API scripts from the server.

In its current implementation this method downloads entire Schema from the Data Abstract server.

 

method LoadScripts

 

void LoadScripts()

 

Sub LoadScripts

NewRow<T>    (declared in LinqDataAdapter)

 

method NewRow<T>: T

 

T NewRow<T>()

 

Function NewRow<T> As T

ProcessPendingChangeDeltas  protected    (declared in LinqDataAdapter)

 

method ProcessPendingChangeDeltas(serverDeltas: array of Delta; originalDeltaChangeIds: IDictionary<String, array of Int32>)

 

void ProcessPendingChangeDeltas(Delta[] serverDeltas, IDictionary<String, Int32[]> originalDeltaChangeIds)

 

Sub ProcessPendingChangeDeltas(serverDeltas As array of Delta, originalDeltaChangeIds As IDictionary<String, array of Int32>)

Parameters:

  • serverDeltas:
  • originalDeltaChangeIds:

ReadSchema

 

method ReadSchema(forceRefresh: Boolean): Schema

 

Schema ReadSchema(Boolean forceRefresh)

 

Function ReadSchema(forceRefresh As Boolean) As Schema

Parameters:

  • forceRefresh:

ReadStreamerSchema  protected

Downloads the Schema from the data service as binary stream.

 

method ReadStreamerSchema: Binary

 

Binary ReadStreamerSchema()

 

Function ReadStreamerSchema As Binary

remove_OnApplyChanges    (declared in LinqDataAdapter)

 

method remove_OnApplyChanges(value: EventHandler)

 

void remove_OnApplyChanges(EventHandler value)

 

Sub remove_OnApplyChanges(value As EventHandler)

Parameters:

  • value:

RemoveAsyncResult    (declared in LinqDataAdapter)

 

method RemoveAsyncResult(query: IQueryable)

 

void RemoveAsyncResult(IQueryable query)

 

Sub RemoveAsyncResult(query As IQueryable)

Parameters:

  • query:

ThrowFailures  protected    (declared in LinqDataAdapter)

This method is called at the end of the ApplyChanges method. It throws a DAUpdatesFailedException if the provided aChanges list is not empty (which means that some DeltaChanges were not processed successfully) and the FailureBehavior property is set to FailureBehavior.RaiseException or FailureBehavior.Both.

 

method ThrowFailures(changes: List<DeltaChange>; failureMessage: String)

 

void ThrowFailures(List<DeltaChange> changes, String failureMessage)

 

Sub ThrowFailures(changes As List<DeltaChange>, failureMessage As String)

Parameters:

  • changes:
  • failureMessage:

TriggerApplyChanges  protected    (declared in LinqDataAdapter)

 

method TriggerApplyChanges

 

void TriggerApplyChanges()

 

Sub TriggerApplyChanges

UpdateRow<T> (T): DeltaChange    (declared in LinqDataAdapter)

 

method UpdateRow<T>(data: T): DeltaChange

 

DeltaChange UpdateRow<T>(T data)

 

Function UpdateRow<T>(data As T) As DeltaChange

Parameters:

  • data:

UpdateRow<T> (T, T): DeltaChange    (declared in LinqDataAdapter)

 

method UpdateRow<T>(originalData: T; newData: T): DeltaChange

 

DeltaChange UpdateRow<T>(T originalData, T newData)

 

Function UpdateRow<T>(originalData As T, newData As T) As DeltaChange

Parameters:

  • originalData:
  • newData:

 

OnApplyChanges    (declared in LinqDataAdapter)

This event is fired before any data changes are sent to the DataAbstract server. It can be used to perform data validation, changes logging, etc.

 

event OnApplyChanges: EventHandler;

 

delegate EventHandler OnApplyChanges()

 

Event OnApplyChanges As EventHandler

See Also