I am trying to save html table to sql server table with unique name and save its data in a database.
For example, I have a html table like this(it is dynamically created in browser by user).

I use asp.net, C#, Sql Server 2008 express.
How can after clicking on save button, create table with unique name, 2 colums int and varchar(40) types, and insert data?
I think it is possible by rendering table to XML, and then work this xml on C# classes, then save in database.
What you sing about it?
Added after edit?
i want save this:
<table>
<tr>
<td>int</td>
<td>varchar(40)</td>
</tr>
<tr>
<td>1</td>
<td>USA</td>
</tr>
<tr>
<td>2</td>
<td>Canada</td>
</tr>
<tr>
<td>3</td>
<td>Mexico</td>
</tr>
</table>
like this:
CREATE TABLE uniqueName
(key int,
values varchar(50))
INSERT INTO uniqueName (key, values)
VALUES (1, 'USA')
INSERT INTO uniqueName (key, values)
VALUES (2, 'Canada')
INSERT INTO uniqueName (key, values)
VALUES (3, 'Mexico')
will help peace of code more:) or links
You could create two tables – one for the entry for the Html table as such (with an
IDguaranteed to be unique, and a name for the Html table), and another one for the data contained in the table:You’ll want to create a foreign key referential integrity between the two tables on the
HtmlTables.IDfield:and you most likely also want to make sure each sequence number shows up only once for each HtmlTableID, so create a unique index.
Now you could store each HTML table into an entry in
dbo.HtmlTables, and each row in the grid can be stored into a row indbo.HtmlTableDataand be associated with the HTML table entry through the foreign key relationship, and it will be sequenced properly by means of theSequencefield.