locked
Bulk insert capability? RRS feed

  • Question

  • User526797452 posted

    What would be the best way to add bulk insert ability?  Seems the client has a bunch of information which is similar (same user, same meta data, just the date changes) and they want to be able to ad these quickly.  It's not always like that.. its mostly 1 at a time, but once a month they have to put in a lot of data.

     

    Any help would be appreciated.

     

    Jason

    Sunday, April 6, 2008 11:17 PM

Answers

  • User2026216502 posted

    Please see my answer here : http://stackoverflow.com/questions/30866824/asp-net-dynamicdata-import-datas-from-excel/30876946#30876946

    I'm using it and it's pretty cool ... using this approach I've been able to fill the database with data from various sources (format must be Excel or CSV)

    The other way to speed up data entry when you have a more complex DB schema is to create a custom page in regular ASP.NET (without any DD features) dedicated to data entry.

    The "problem" with DD is that a good normalized DB schema does not necessarily make it easy for the user to enter data quickly.

    When you start having a lot of tables, even with a lot of foreign keys, the user is easily lost.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 29, 2015 1:15 AM
  • User503812343 posted

    SQLBulkCopy namespace is the best solution to insert bulk content to SQL server Database

    It gives you flexibility to get data from any source, if required format it and insert it into sql  in batches

    for more info check

    http://dotnetmentors.com/c-sharp/bulk-upload-into-sql-server-using-sqlbulkcopy-and-c-sharp.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 29, 2015 2:33 AM

All replies

  • User-2032370290 posted
    I guess you need to use this structure of quarry when you are inserting  :<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> 

     

    INSERT INTO TableA (ColumnA1, ColumnA2) SELECT ColumnB1, ColumnB2 FROM TableB 
    
    
     
    Monday, April 7, 2008 12:56 AM
  • User526797452 posted

    But I need the Web UI for this using DynamicData controls. And I would like to be able to do this -> Click New, type in info, Click Insert -> (viewstate remains) change some data, hit insert, change some data, Insert.. etc

    Monday, April 7, 2008 9:35 AM
  • User-1447244199 posted

    Hi,

    you could change the code in the triggered event when an item is inserted to retain actual state instead of going to list mode. Something like this should do the trick :  

     protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) {
    if (e.Exception == null) {
    //Response.Redirect(table.ListActionPath);
    e.KeepInInsertMode = true; // this will keep your data on the page
    }
    }

    hope it helped,

    Monday, April 7, 2008 5:03 PM
  • User-167277497 posted

    Hi jaybuffet,

    Was this ever resolved? I have the exact same scenario and need reolution quickly.

    Thanks!

    Monday, March 24, 2014 12:05 AM
  • User-330204900 posted

    There is no easy was to do this you will just have to code it. There was a solution for LightSwitch that allowed bulk import of data but that used WPF.

    Tuesday, March 25, 2014 9:38 AM
  • User2026216502 posted

    Please see my answer here : http://stackoverflow.com/questions/30866824/asp-net-dynamicdata-import-datas-from-excel/30876946#30876946

    I'm using it and it's pretty cool ... using this approach I've been able to fill the database with data from various sources (format must be Excel or CSV)

    The other way to speed up data entry when you have a more complex DB schema is to create a custom page in regular ASP.NET (without any DD features) dedicated to data entry.

    The "problem" with DD is that a good normalized DB schema does not necessarily make it easy for the user to enter data quickly.

    When you start having a lot of tables, even with a lot of foreign keys, the user is easily lost.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 29, 2015 1:15 AM
  • User503812343 posted

    SQLBulkCopy namespace is the best solution to insert bulk content to SQL server Database

    It gives you flexibility to get data from any source, if required format it and insert it into sql  in batches

    for more info check

    http://dotnetmentors.com/c-sharp/bulk-upload-into-sql-server-using-sqlbulkcopy-and-c-sharp.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 29, 2015 2:33 AM
  • User-330204900 posted

    Hi that answer is really cool thanks :)

    Wednesday, July 29, 2015 4:46 AM