adapter
asp.net 2.0
orm 2.0.7.122
I have a webform that contains a datasource which contains an entity collection. Within a button click event not linked to the datasource I want to
- create a filtered view of the datasource's entity collection
- update records within this view
- insert a new record into the db outside the datasource
- call the datasource.refetchIf I do this the displayed data in the gridview is only the filtered record and not all records. It seems to keep the IEntityView2 filter properties even though that filtered view only exists within the button click event.
If I use the entitycollection.findmatches() function I get my index, execute my actions and refetch with out a problem. This is my current solution.
After re-reading the docs I believe I needed to use EntityView2<T> instead of the IEntityView2 so I could set the datachangeaction to NoAction. However I could not cast the datasource.entitycollection.defaultview to an EntityView2<T>. I received an error stating an invalid cast between non-generic collection and generic collection of type<t>.
Shouldn't this be possible? convert an entitycollection from a datasource object to a generic entityview? If so, what am I missing? If not, what prevents this cast?
datasource object
<llbl:LLBLGenProDataSource2
ID="CommissionRatesDataSource"
runat="server"
AdapterTypeName="SBI.MacolaApps.DAL.DatabaseSpecific.DataAccessAdapter,
SBI.MacolaApps.DALDBSpecific"
DataContainerType="EntityCollection"
EntityFactoryTypeName="SBI.MacolaApps.DAL.FactoryClasses.BrokerCommissionRateEntityFactory,
SBI.MacolaApps.DAL"
LivePersistence="False"
OnPerformGetDbCount="CommissionRatesDataSource_PerformGetDbCount"
AllowDuplicates="False"
EnablePaging="True"
OnPerformSelect="CommissionRatesDataSource_PerformSelect"
OnPerformWork="CommissionRatesDataSource_PerformWork" />