Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Delete all Rows from a Table
 

Pages: 1
Designer
Delete all Rows from a Table
Page:1/1 

  Print all messages in this thread  
Poster Message
DerekLi
User



Location:

Joined on:
08-Aug-2007 20:27:45
Posted:
8 posts
# Posted on: 05-Sep-2007 21:15:36.  

Search around in this Forum, but could not find thread talking about Delte All Rows in a Table. So I start a new thread here.

We are using LLBLGen Pro v2.5.

How to delete all rows from a Table quickly and efficiently, without fetching all the data into a EntityCollection?

How can I write code to use LLBLGen code to execute a SQL code " delete from precheck"?

Thanks

Derek




  Top
DerekLi
User



Location:

Joined on:
08-Aug-2007 20:27:45
Posted:
8 posts
# Posted on: 05-Sep-2007 21:56:16.  

Sorry, I found a few links in the forum discussing this.

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3598&HighLight=1

Please ignore this thread. Embarrassed
Thanks

Derek


  Top
JimHugh
User



Location:
Davis, CA
Joined on:
16-Nov-2005 14:32:25
Posted:
191 posts
# Posted on: 05-Sep-2007 22:02:56.  
For Adapter use DeleteEntitiesDirectly with null fo rthe filterbucket.

For SelfServicing use one of the DeleteMulti overloads, eg yourcollection.DeleteMulti(null);

Jim Hughes  Top
DerekLi
User



Location:

Joined on:
08-Aug-2007 20:27:45
Posted:
8 posts
# Posted on: 06-Sep-2007 17:06:24.  

For v2.5, there is a overloaded method for DeleteEntitesDirectly, which takes typeOfEntity as the first argument.

But when I run the following function:
Code:
adapter.DeleteEntitiesDirectly(EntityType.PrecheckEntity, Nothing)


it gives exception as following:

Code:
{System.ArgumentException}
    System.ArgumentException: {"The element name '16' isn't known in this provider
Parameter name: elementName"}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: Nothing
    InnerException: Nothing
    Message: "The element name '16' isn't known in this provider
Parameter name: elementName"
    Source: "SD.LLBLGen.Pro.ORMSupportClasses.NET20"
    StackTrace: " at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceInfoProviderBase.GetElementMappingInfo(String elementName)
at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceInfoProviderBase.GetAllFieldPersistenceInfos(String elementName)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetFieldPersistenceInfos(String entityName)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.DeleteEntitiesDirectly(String entityName, IRelationPredicateBucket filterBucket)
at RequstManagement.CheckFile(String strName) in C:\Projects\EG\Agco.Shs\Agco.Shs.BusinessLogic\RequstManagement.vb:line 74"
    TargetSite: {System.Reflection.RuntimeMethodInfo}



Apparently, it does not like the type I passed in.

But if I use the original method:
Code:
adapter.DeleteEntitiesDirectly("PrecheckEntity", Nothing)


it works fine.

What typeOfEntity should I pass in?

Thanks

Derek


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38044 posts
# Posted on: 06-Sep-2007 20:33:24.  
Either pass a string or pass the Type Regular Smiley (typeof(PrecheckEntity) )
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.