-3

I have generated a HTML table using copying data from Excel file and pasting it in a textbox and running jQuery to parse it.

To achieve this I followed the question- Copy/Paste from Excel to a web page

Now the next requirement is I need to insert data from this HTML table into database table.

How can this be done in ASP.NET web forms?

Community
  • 1
  • 1
soccer7
  • 3,547
  • 3
  • 29
  • 50

1 Answers1

1

Write an ASP page that accepts the data, parses the ',andtags into rows of values and then do a SQLINSERT` statement.

But why first encode it into the ',and` fields in the first place? Why not paste the data and submit it to your server, and then, on the server do the parsing?

var rows = data.split("\n");

for(var y in rows) {
    var cells = rows[y].split("\t");

    // call sql 'INSERT' supplying cell[0]  ... cell[n]
    // as the arguments values of  the INSERT         
}

}

Jens Meinecke
  • 2,904
  • 17
  • 20