public esLoadDataTable ( |
||
request | Contains all of the information necessary to issue and carry out the request | |
sig | Contains the required information to locate the EntitySpaces DataProvider | |
Résultat |
/// <summary> /// Execute the Query and loads your BusinessEntity. /// If you need to be notified that this is being called /// override BusinessEntity.Query.OnLoadEvent(). /// </summary> /// <remarks> /// The default conjunction is AND. /// You can change the default conjunction this way: /// <code> /// emps.Query.es.DefaultConjunction = tgConjunction.Or; /// </code> /// </remarks> /// <returns>True if at least one record was loaded</returns> virtual public bool Load() { bool loaded = false; DataTable table = null; FixupSerializedQueries(); tgDataRequest request = new tgDataRequest(); this.PopulateRequest(request); tgDataProvider provider = new tgDataProvider(); tgDataResponse response = provider.esLoadDataTable(request, this.tg2.Connection.ProviderSignature); table = response.Table; if (prefetchMaps != null) { foreach (tgPrefetchMap map in prefetchMaps) { // Give our Prefetch Queries the proper connection strings if (!map.Query.tg2.HasConnection) { string generatedName = this.GetConnectionName(); if (generatedName != null) { // Use the connection name typed into the generated master when they // generated the code map.Query.tg2.Connection.Name = generatedName; } else { // Use the connection from the Collection/Entity at the time they // call Load() map.Query.tg2.Connection.Name = this.connection.Name; } } map.Table = map.Query.LoadDataTable(); } } if (this.OnLoadDelegate != null) { loaded = OnLoadDelegate(this, table); } return(loaded); }
/// <summary> /// This merely parses and returns the SQL Syntax, no SQL is executed. /// </summary> /// <remarks> /// The default conjunction is AND. /// You can change the default conjunction this way: /// <code> /// emps.Query.es.DefaultConjunction = tgConjunction.Or; /// </code> /// </remarks> /// <returns>The SQL Syntax, the same as query.es.LastQuery when a query is executed.</returns> virtual public string Parse() { FixupSerializedQueries(); tgDataRequest request = new tgDataRequest(); this.PopulateRequest(request); request.QueryType = tgQueryType.DynamicQueryParseOnly; tgDataProvider provider = new tgDataProvider(); tgDataResponse response = provider.esLoadDataTable(request, this.tg2.Connection.ProviderSignature); return(response.LastQuery); }
/// <summary> /// Execute the Query and load a DataTable. /// </summary> /// <returns>A DataTable containing the loaded records.</returns> virtual public DataTable LoadDataTable() { DataTable table = null; FixupSerializedQueries(); tgDataRequest request = new tgDataRequest(); this.PopulateRequest(request); tgDataProvider provider = new tgDataProvider(); tgDataResponse response = provider.esLoadDataTable(request, this.tg2.Connection.ProviderSignature); table = response.Table; return(table); }