c# - Bulk update in SQL database using generic class object -
i working c#.net application.. wanted update bluck of records in database particular chunk or batch.. in code maintaining generic class object collection , needs update database in chunk..
list<testrecord> recordcollection = new list<testrecord>(); recordcollection.add(new testrecord(id = 1,name = 'test',body = 'html')) recordcollection.add(new testrecord(id = 2,name = 'test2',body = 'html2')) maintaining batches 3000 records set chunk of data updation. if(recordcollection.count > 3000) { == update record set in database using single update query.. }
i have searched few of method bluck update below,
creating datacontext.
creating linq sql
using userdefinetable type, method require datatable instead generic class.
is there direct method can directly use generic object collection ? scenario mentioned in above code.
and if there no direct way bluck update using generic class best way use case.
please advise.
thanks
Comments
Post a Comment