Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to import large amounts of data into ListView (Example)

$
0
0

See the K18260 KB Article for more information.

See also:
ORM Magic–Importing from any datasource

Note
This example cannot be automatically converted to VB.NET because of the VB.NET compiler limitations. We apologize for any inconvenience...

Question Comments

Added By: Tony Tadros at: 12/11/2012 4:51:05 AM    

Hello Devexpress ,

do yo have any update about such functionality,do you have a plan to create or update current rows from excel as built in in the future

Added By: Dennis (DevExpress Support) at: 2/5/2013 10:55:49 PM    

@Tony: Here is a recent blog post on this functionality:
http://community.devexpress.com/blogs/eaf/archive/2012/12/29/orm-magic-importing-from-any-datasource.aspx

You can find more solutions in www.devexpress.com/issue=AS10553

Added By: Andreas Mummenhoff at: 8/22/2013 7:50:48 PM    

Hello Dennis,

regarding VB conversion and porting to 13.1, here a short guide:

At first you have to fix one line in the C# project to convert it to 13.1
...
RuleSetValidationResult validationResult =
                                    Validator.RuleSet.ValidateTarget(
                                    nestedImportObjectSpace, obj, new ContextIdentifiers(DefaultContexts.Save.ToString()));

After that you can use a converter to create a VB solution.
Then in the VB project Dennis.ImportData, you have to fix the delegate definitions:
...
Public Delegate Function ImportDataDelegate(Of T)(
               ByVal objectSpace As IObjectSpace, <[ParamArray]> ByVal args() As Object) As T

Public Delegate Function ValidateDataDelegate(Of T)(
               ByVal data As T, <[ParamArray]> ByVal args() As Object) As Boolean

and at least you have to be correct in creating a delegate in

Public Shared Function CreateCoolPersonImportDataFromExcelDelegate() As ImportDataDelegate(Of Person)
     Return Function(os As IObjectSpace, args() As Object) As Person
               Throw New NotImplementedException("TODO: you can use the FileHelpers library to ...")
          End Function

End Function

Then the project will run in VB too :-)

Added By: Fernando Minguet at: 6/16/2016 11:34:04 AM    Is this implementation still based on UnitOfWork? I couldn't find any reference to UnitOfWork in the code, as found in K18260.

Per K18260: "...The use of the XAF's ObjectSpace class is not recommended here because it is not as lightweight as the UnitOfWork."

Best Regards,


Added By: Dennis (DevExpress Support) at: 6/17/2016 8:22:11 AM    @Fernando:  I apologize for the confusion, because the K18260 article is outdated. We will consider updating it. It is also correct to use independent (that doesn't belong to a View) XPObjectSpace/XPNestedObjectSpace classes here and this approach is actually demonstrated in this example implementation.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>