deleting all records

Posts   
 
    
jspruit
User
Posts: 17
Joined: 11-Nov-2005
# Posted on: 30-Nov-2005 17:02:37   

Hi,

For a SQLCE application i need to delete all records in a table. i'm using adapter scenario and use DeleteEntityCollection(). This works quite slow because i first have to fetch the collection and delete it.

Is there a faster possibility to accomplish this.

I also have this problem importing bulk csv data in database but i think i will start using SSCEDirect(http://www.fitiri.com/SSCEDirect.html) as it just ADO.net on CF making it too slow.

Thanks in advance.

Regards,

Jan

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 30-Nov-2005 18:00:21   

jspruit wrote:

Hi,

For a SQLCE application i need to delete all records in a table. i'm using adapter scenario and use DeleteEntityCollection(). This works quite slow because i first have to fetch the collection and delete it.

Is there a faster possibility to accomplish this.

I also have this problem importing bulk csv data in database but i think i will start using SSCEDirect(http://www.fitiri.com/SSCEDirect.html) as it just ADO.net on CF making it too slow.

Thanks in advance.

Regards,

Jan

Will DeleteMulti in the collection do what you want?

BOb

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 30-Nov-2005 18:48:14   

Try Adapter.DeleteEntitiesDirectly. Which should generate a DELETE FROM table WHERE... query.

Frans Bouma | Lead developer LLBLGen Pro
jspruit
User
Posts: 17
Joined: 11-Nov-2005
# Posted on: 01-Dec-2005 11:24:58   

Hi

Thanx this works much faster! Delete and load together with SSCEDirect of 350 records now only takes a second where it used to do it in more then a minute. simple_smile

simple_smile Regards,

Jan