Last post Feb 27, 2017 09:35 AM by Eric Du
Jan 13, 2017 09:13 PM|Asp.net king|LINK
In a web form, how can i create a database virtual table that enables the user to specify columns and generate these columns to database virtual table?
Jan 13, 2017 10:04 PM|PatriceSc|LINK
Not sure what you call a "database virtual table". My understanding is that you want to allow user defined columns in your application. Is this correct?
What is your db? My first thought would be to look at XML or JSON support (for example
https://msdn.microsoft.com/en-us/library/dn921897.aspx if using SQL Server).
Jan 26, 2017 07:45 AM|Asp.net king|LINK
I want user to specify number of columns in the virtual table. Each teacher have many subjects, each subject have various assessments. How i can do this?
SQL server, Asp.net C#
Jan 26, 2017 08:27 AM|PatriceSc|LINK
It's not done this way. You would have a table for teachers and subjects with just their 'attributes". The relation between both would use a 3rd table that matches a teacher id with a subject id. As this is a table you can have multiple rows for a single
teacher id and multiple rows for a single subject id. Then you would have assessments with likely a single column with the subject id it belongs to...
In short relations between teachers, subjects and assessments are not part of your db structure. They are just data stored in your tables possibly adding an explicit relation table for many to many relations....
Feb 26, 2017 12:13 PM|Asp.net king|LINK
Please help to solve this post
Feb 27, 2017 09:35 AM|Eric Du|LINK
Hi asp.net King,
Here are two tutorials about how to dynamically create data table in asp.net and insert it to the database. Please check:
Dynamically create DataTable and bind to GridView in ASP.Net:
Insert (Save) DataTable to SQL Server Table using C# and VB.Net: