Introduction | |||||||
A Hierarchical Data is a data that is organized in a tree-like structure and structure allows information to be stored in a parent-child relationship with one-to-many relation records. This data can be stored either in a single table or different database tables with a parent-child relationship using foreign key. | |||||||
|
|||||||
|
|||||||
Setup the Repeater Control: In the aspx page, drag and drop a Repeater |
|||||||
|
|||||||
Setup the Code-Behind:
The code-behind for this concept needs some attention, as it explains you the way Step 1: Add the SqlClient namespace in the code-behind
Step 2: In the Page_Load event, you have to retrieve the
Step 3: Add the DataTable to a DataSet to add relationship
Step 4: Now create two DataColumn objects, one for Primary
Step 5:
Step 6: Very Important, we need this DataRelation object
Step 7: Finally, we need to add this relationship to the
|
|||||||
|
|||||||
|
|||||||
The above method GetChildObjects, has two parameters, the first one is the array of DataRow and the second is the “ref” DataTable which is going to have the records. Please note the “ref” keyword before the parameter declaration. This DataTable is responsible to hold the records to binding. Inside this method, we loop through the records of the DataRow arrays and we import record by record to the “ref” DataTable. Then again we call the same method GetChildObjects, to loop through its child rows. If there is no child rows, then execution will be stopped and no further call to this method will be made. Now, we are going to write another method to kick off the GetChildObjects methods, |
|||||||
|
|||||||
|
|||||||
Step 8: The last step in the Page_Load event, is to bind the Repeater control by calling the GetParentObjects as follows. Note that the argument passed to the GetParentObjects method is the DataSet’s first Table, not the DataTable object. |
|||||||
The complete code of the Page_Load event is as follows,
Setup Asp.Net Table Control to display the Hierarchy structure To display the data in a Hierarchical structure, we need to code in the ItemDataBound |
|||||||
The above code is simple as its need no detail explanation. First we find the Table Now save all and press the “F5” button, the browser will popup, you can see the |
asp.net Hierarchical Data
时间: 2024-10-17 02:57:52
asp.net Hierarchical Data的相关文章
Dynamics CRM 2015 New Feature (2): Hierarchical Data
在Dynamics CRM 2015中引入了一个比较有意思的Feature:Hierarchical Data.用户可以用直观的树形图来了解具有树形结构的数据,例如business unit,相信通过这样一个有意思的feature,能给大家提高不少的工作效率. 使用这个feature也并不麻烦,我们需要做如下配置:1)新建一个自身引用的1:N关系,这样我们可以用这个关系来构造树形的数据结构,2)开启实体的Hierarchy Settings.开启后的效果如下: 1)创建自身引用的1:N关系 2)
CS0016: 
未能写入输出文件“c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET 
Files\data\34aae060\b7daa87d\App_Web_addadvice.aspx.cdcab7d2.ekhlcbjd.dll”--“目录名无效。 
”
产生原因:应用程序运行时产生的临时文件需要存放到c:"windows"temp 文件夹下 而运行基于microsoft .net framework 框架下的应用程序 需要对temp 具有读写的权限 ,所以程序运行产生的临时文件不能存储或读取 ,或者路径不存在的情况下都会产生编译错误. 解决方法: 1.设置c:windows\temp 目录访问权限 temp--> 属性-->安全-- > 添加了iis_user和network service -->都赋予其权
Hierarchical Data Library多层次数据显示控件下载及介绍
Hierarchical Data Library是一款功能强大的多层次数据显示控件,包含了DataTreeGridView,支持所有.NET语言,可以用于Windows桌面应用程序,支持数据绑定.标准的界面和操作自定义设置,本地化和主题支持. 具体功能: 控件在界面.操作上都和标准的DataGridView控件相似 支持自定义列 允许某一列显示为树型结构 支持数据绑定 对数据节点进行管理 允许最终用户扩展和收缩节点,增加或者减少节点的缩进,还可以设置某一节点为只读 支持本地化显示日期和数字原文
Managing Hierarchical Data in MySQL(邻接表模型)[转载]
原文在:http://dev.mysql.com/tech-resources/articles/hierarchical-data.html 来源: http://www.cnblogs.com/phaibin/archive/2009/06/09/1499687.html 译文:Yimin 引言 大多数用户都曾在数据库中处理过分层数据(hierarchical data),认为分层数据的管理不是关系数据库的目的.之所以这么认为,是因为关系数据库中的表没有层次关系,只是简单的平面化的列表:而分
ASP.NET Core 数据保护(Data Protection)【上】
小分享:我有几张阿里云优惠券,用券购买或者升级阿里云相应产品最多可以优惠五折!领券地址:https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=ohmepe03 前言 上一篇博客记录了如何在 Kestrel 中使用 HTTPS(SSL), 也是我们目前项目中实际使用到的. 数据安全往往是开发人员很容易忽略的一个部分,包括我自己.近两年业内也出现了很多因为安全问题导致了很多严重事情发生,所以安全对我们开发
ASP.NET ViewState详解
ASP.NET ViewState详解[转载] asp.net存储textboxserializationstring服务器 作者:Infinities Loop 概述 ViewState是一个被误解很深的动物了.我希望通过此文章来澄清人们对ViewState的一些错误认识.为了达到这个目的,我决定从头到尾详细的描述一下整个ViewState的工作机制,其中我会同时用一些例子说明我文章中的观点,结论.比如我会用静态控件(declared controls)和动态控件(dynamic contro
zoj3826 Hierarchical Notation (字符串模拟)
Hierarchical Notation Time Limit: 2 Seconds Memory Limit: 131072 KB In Marjar University, students in College of Computer Science will learn EON (Edward Object Notation), which is a hierarchical data format that uses human-readable text to trans
ASP.NET Routing
ASP.NET Routing Other Versions ASP.NET routing enables you to use URLs that do not have to map to specific files in a Web site. Because the URL does not have to map to a file, you can use URLs that are descriptive of the user's action and therefore a
Indexing Sensor Data
In particular embodiments, a method includes, from an indexer in a sensor network, accessing a set of sensor data that includes sensor data aggregated together from sensors in the sensor network, one or more time stamps for the sensor data, and metad