SQLbulk copy

Posts   
 
    
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 24-Aug-2006 15:17:00   

Hello all,

I'm hoping to use this software as an intermediate step in performing a SQLbulk copy.

Does anyone have any examples of this? I was thinking of doing

Creating an entity collection with many entities (I'm loading into the database various rows from various data sources), no relationships just simple entities possibly using projections? (Hopefully there's an easier and quicker way of obtaining the required table) To create the required data table for use with WriteToServer(dt); as in -

http://www.eggheadcafe.com/articles/20060318.asp is a quick example, can I use LLBL gen to easily create the middle step, I would have thought so

Thanks for your help,

Matthew

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 24-Aug-2006 16:35:08   

I think using LLBLGen Pro entities, collections to save data will not be a BulkCopy solution.

To copy data in bulk I guess you should do it manually by using the appropriate libraries. Or tools like DTS if you do it rarely.

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 25-Aug-2006 11:26:53   

Do you have any plans for helping with this feature in future?

As far as I can see, you would just need a method which returns a data table with the exact same structure as the entity?

As collections only seem to work with update/delete? Is there a way to do something like Insert multi?

can we adapt/ use unit of work. Add for save

This is conjecture on my part as I'm new to this.

Thanks,

Matthew

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 25-Aug-2006 12:32:58   

FYI there is a System.Data.SqlClient.SqlBulkCopy class in .net 2.0 that might be usable for you.

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 25-Aug-2006 14:13:34   

Thanks

Yes, this is the functionality I'm referring to in my original post, the bulk copy writer can take various inputs, and I was hoping there was an easy way to take my strongly typed entities, stick them in a collection and return the required input as a data table or whatever.

Not to worry, thanks for your help

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 25-Aug-2006 14:25:52   

Hi,

Ah, OK, I see. Perhaps you should implement IDataReader interface on your entity collection? It shouldn't be too difficult.