如何动态创建表? [英] How to create table dynamically ?

查看:325
本文介绍了如何动态创建表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在开发一个项目,我必须动态设计一个表。我拥有构建表所需的所有数据。还有某些组。例如,如果我们将年龄视为一个群体。所以它可能有2个子组,如0-50,50-100。现在在0-50子组中,我有另外两个子组,如0-25,26-50。所以现在的问题是这个细节不是静态的。数据是完全动态的。我在这些群体之间有关系,通过这种关系我可以确定这个值与这个群体有关。所以我请你告诉我如何在C#中完成这个任务。如何使用c#在页面上设计这个表。我真的需要你的帮助。请给我生成这种设计的工具的名称。



谢谢。

Hello,
I am working on one project in which i have to design a table dynamically.I have all the data that is needed to build a table.There are also certain Groups. For E.g If we consider age as a group. So it may have 2 subgroups like 0-50,50-100. Now in a sub group 0-50, i have two another sub groups like 0-25,26-50. So now the thing is this details are not static.Data is totally dynamic. I have relationship among this groups by which i can identify that this value is related to this group. So I requesting you please tell me how can i accomplish this task in C#.How can i design this table on page using c#. I really need your help. Please give me name of the tool which generate this kind of design.

Thank You.

推荐答案

你建议不需要动态表。您只需要一张包含人物的表格,一张包含年龄类别的表格和一张将这些表格链接在一起的表格。问题还在于您是否需要经常访问该信息。否则,您可以在需要时生成人员年龄类别。



大多数时候动态创建的表很难在程序中处理,因为你不知道会发生什么。很难查询它们,因为每次构建查询时都需要有关表结构的信息。所以我真的认为你应该重新考虑你的数据结构,以及是否真的需要动态表。



祝你好运!
What you suggest wouldn't need dynamic tables. You simply would need a table with people, a table with age categories and a table to link those together. The question would also be if you need access to that information very often. Otherwise you could generate a persons age categories just when you need them.

Most of the time dynamically created tables are hard to handle in a program because you don't know what to expect. It is hard to query them because you need information about the table structure every time you build a query. So I really think you should reconsider your data structure and if dynamic tables are really necessary.

Good luck!


这篇关于如何动态创建表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆