Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 647605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:44:26+00:00 2026-05-13T21:44:26+00:00

I am trying to save html table to sql server table with unique name

  • 0

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).

int  varchar(20)

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:44:26+00:00Added an answer on May 13, 2026 at 9:44 pm

    You could create two tables – one for the entry for the Html table as such (with an ID guaranteed to be unique, and a name for the Html table), and another one for the data contained in the table:

    CREATE TABLE dbo.HtmlTables
    (ID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
     HtmlTableName VARCHAR(100)  -- or whatever length you need
    )
    
    CREATE TABLE dbo.HtmlTableData
    (ID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
     HtmlTableID INT NOT NULL,
     Sequence INT NOT NULL,
     Key INT,
     Value VARCHAR(500)
    )
    

    You’ll want to create a foreign key referential integrity between the two tables on the HtmlTables.ID field:

    ALTER TABLE dbo.HtmlTableData
      ADD CONSTRAINT FK_HtmlTableData_HtmlTables
      FOREIGN KEY(HtmlTableID) REFERENCES dbo.HtmlTables(ID)
    

    and you most likely also want to make sure each sequence number shows up only once for each HtmlTableID, so create a unique index.

    CREATE UNIQUE INDEX UIX01_HtmlTableData
      ON dbo.HtmlTableData(HtmlTableID, Sequence)
    

    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 in dbo.HtmlTableData and be associated with the HTML table entry through the foreign key relationship, and it will be sequenced properly by means of the Sequence field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 317k
  • Answers 317k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I do not think you should do it as the… May 13, 2026 at 11:44 pm
  • Editorial Team
    Editorial Team added an answer You can review the differences with a: git log HEAD..origin/main… May 13, 2026 at 11:44 pm
  • Editorial Team
    Editorial Team added an answer Likely you're talking about the same thing in both cases.… May 13, 2026 at 11:44 pm

Related Questions

I am working on sql server where i want to save html code into
A very flowery title indeed. I have a PHP web application that is in
I am trying to scrape an html table and save its data in a
I am trying to save a mobile number in MYSQL table with the following
I'm trying to get this to work, but I am having issues. What am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.