Looking for Best way to TO bulk insert / update data in database RRS feed

  • Question

  • Hello Mates, 

    I have the following requirement: a Data Table loads a view of data from the database using a SQL connection  

    Finally after some data modification I want to update back to database.

            I mean that data modification needs to submit back to database.

            I have a special case where data will be modified from the and transforms in different action like merge clone etc         but structure remains same.

    Note: May be Datatable done changes or added new rows in memory but I want submit the update once

    Actually i am deleting all  rows in Database  before performing  Bulk insert to DB 

    Sample flow 

    Load Table in DB into Datatable type ( assume 15000 rows )

    Datatable Do modification to table / add new rows  // update   // etc.... ( assume 15000 + 500   added rows ) and few rows modified  finally i have  new data table 

    Delete existing  data in DB   ------  i know its not correct approach 

    Submit Datatable using Bulk insert  

    I perform same think by using Sql Statements but i feel slow please guide any approach which is faster and better way 

    I am looking for ideas, please give some inputs on this

    some sample code or links

    Thanks Ranjith

    Ranjith@Learner @Microsoft products

    Wednesday, May 4, 2016 8:38 AM