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?
我认为可以通过将表格渲染为XML,然后在C#类上处理该XML,然后保存到数据库中。
你唱的是什么?
编辑后添加?
我想要保存这个。
<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>
像这样:
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 )
会帮助代码的和平更多:)或链接