Displaying Nested Relational Data

印尼稻米收成与粮食安全数据集2026年 本数据集收录印度尼西亚2026年水稻收成与粮食安全遥测数据,包含10000条稻米农业收成产量与粮食安全监测记录,围绕印尼国家粮食安全体系中的核心作物水稻展开。稻米是印尼逾两亿人口的主粮,其收成波动直接影响国家粮食安全与进口政策,本数据集将种植区域、收成产量、气候与土壤相关遥测指标整合为结构化表格,可支撑粮食产量预测、收成影响因素分析、区域粮食安全评估与农业政策模拟等研究任务。典型应用场景包括:农业时间序列产量预测模型构建、气候因子与水稻收成的关联分析、省份与地区层面的粮食自给率测算、粮食安全风险预警指标设计,也可作为农业经济、粮食政策与数据科学交叉课程的教学素材。数据为2026年最新版,规模约1.2MB、单CSV结构规整,字段命名清晰,适合Python、Pandas、Scikit-learn等主流工具链直接使用,便于开展探索性分析、可视化与机器学习全流程练习。重要说明:本数据为遥测整理数据,分析结论以数据集文档口径为准,农业决策请结合官方统计综合研判。许可:CC0公有领域,可自由使用与二次分发。 立即下载

Displaying Nested Relational Data:
example:
结果:
Professional ATL Com
  ISBN: 1861001401   Release Date: 1998-8-20 0:00:00
  Author(s): Richard Grimes,
  Price: CAN:83.95   GBP:55.49   USD:59.99  
Beginning Visual Basic 5 Objects
  ISBN: 1861001452   Release Date: 1998-4-1 0:00:00
  Author(s):
  Price: CAN:48.95   GBP:32.49   USD:34.99  

Professional MTS & MSMQ Programming With VB And ASP
  ISBN: 1861001460   Release Date: 1998-5-1 0:00:00
  Author(s): Alex Homer, David Sussman,
  Price: CAN:69.99   GBP:46.99   USD:49.99  


关键代码:
<wrox:connect id="ctlConnectStrings" runat="server"/>

<%-- insert the control that creates the DataSet --%>
<wrox:getdataset id="ctlDataSet" runat="server"/>

<div id="divResults" runat="server"></div>

<script language="C#" runat="server">

 void Page_Load(Object sender, EventArgs e)
 {

  // get connection string from ../global/connect-strings.ascx user control
  string strConnect = ctlConnectStrings.OLEDBConnectionString;

  // create a variable to hold an instance of a DataSet object
  DataSet objDataSet;

  // get dataset from get-dataset-control.ascx user control
  objDataSet = ctlDataSet.BooksDataSet(strConnect, "ISBN LIKE '18610014%'");

  if (objDataSet == null)
   return;

  // now we're ready to display the contents of the DataSet object
  // create a string to hold the results
  string strResult = "";

  // create a reference to our main Books table in the DataSet
               //创建datatable
  DataTable objTable = objDataSet.Tables["Books"];

  // create references to each of the relationship objects in the DataSet
               //得到datarelation   .BookAuthors,BookPrices是关系名
  DataRelation objAuthorRelation = objTable.ChildRelations["BookAuthors"];
  DataRelation objPriceRelation = objTable.ChildRelations["BookPrices"];

  // now we can iterate through the rows in the Books table
                //叠代DataRow
  foreach (DataRow objRow in objTable.Rows)
  {
   // get the book details and append them to the "results" string
                       
   strResult += "<b>" + objRow["Title"] + "</b><br />&nbsp; ISBN: " + objRow["ISBN"]
      + " &nbsp; Release Date: " + objRow["PublicationDate"] + "<br />";

   // get a collection (array) of all the matching Author table rows for this row
                     //利用GetChildRows方法取得当前行的所有子表中匹配的行集合(以ISBN为匹配标准)objAuthorRelation是关系。类似的,也可以用GetParentRows方法取得当前行的所有父表中匹配的行集合。当然,这样的话就不是以Book名作为显示次序了。而是以作者名称或者价格作为显示次序了。
   DataRow[] colChildRows = objRow.GetChildRows(objAuthorRelation);

   strResult += "&nbsp; Author(s): ";

   // iterate through all the matching Author records adding to the result string       
                     //遍历所有子表中匹配的行集
   foreach (DataRow objChildRow in colChildRows)
    strResult += objChildRow["FirstName"] + " " + objChildRow["LastName"] + ", ";
   strResult += "<br />";

   // repeat using the Price table relationship to display data from matching Price records
                     //类似的处理价格子表中匹配的行集
   colChildRows = objRow.GetChildRows(objPriceRelation);
   strResult += "&nbsp; Price: ";
   foreach (DataRow objChildRow in colChildRows)
    strResult += objChildRow["Currency"] + ":" + objChildRow["Price"] + " &nbsp; ";
   strResult += "<p />";

  } // and repeat for next row in Books table

  divResults.InnerHtml = strResult;  // display the results

 }
</script>

 DataSet BooksDataSet(string strConnect, string strWhere)的定义:

 public DataSet BooksDataSet(string strConnect, string strWhere)
 {
  outConnect.InnerText = strConnect;  //display connection string

  // specify the SELECT statement to extract the BookList data
  string strSelectBooks = "SELECT * FROM BookList WHERE " + strWhere;
  outSelectBooks.InnerText = strSelectBooks;   // and display it

  // specify the SELECT statement to extract the BookAuthor data
  string strSelectAuthors = "SELECT * FROM BookAuthors WHERE " + strWhere;
  outSelectAuthors.InnerText = strSelectAuthors;   // and display it

  // specify the SELECT statement to extract the BookPrices data
  string strSelectPrices = "SELECT * FROM BookPrices WHERE " + strWhere;
  outSelectPrices.InnerText = strSelectAuthors;   // and display it

  // declare a variable to hold a DataSet object
  // note that we have to create it outside the Try..Catch block
  // as this is a separate block and so is a different scope
  DataSet objDataSet = new DataSet();

  try
  {

   // create a new Connection object using the connection string
   OleDbConnection objConnect = new OleDbConnection(strConnect);

   // create a new Command object
   OleDbCommand objCommand = new OleDbCommand();

   // set the properties
   objCommand.Connection = objConnect;
   objCommand.CommandType = CommandType.Text;
   objCommand.CommandText = strSelectBooks;

   // create a new DataAdapter object
   OleDbDataAdapter objDataAdapter = new OleDbDataAdapter();
   // and assign the Command object to it
   objDataAdapter.SelectCommand = objCommand;

   // get the data from the "BookList" table in the database and
   // put it into a table named "Books" in the DataSet object
   objDataAdapter.Fill(objDataSet, "Books");

   // change the SELECT statement in the ADOCommand object
   objCommand.CommandText = strSelectAuthors;
   // then get data from "BookAuthors" table into the DataSet
   objDataAdapter.Fill(objDataSet, "Authors");

   // and do the same again to get the "BookPrices" data
   objCommand.CommandText = strSelectPrices;
   objDataAdapter.Fill(objDataSet, "Prices");
                        //以上为Dataset创建了三个表

   // declare a variable to hold a DataRelation object
   DataRelation objRelation;

   // create a Relation object to link Books and Authors
                        //定义名为BookAuthors的关系:Books表为父表,Authors为子表,ISBN是连接标准
   objRelation = new DataRelation("BookAuthors",
         objDataSet.Tables["Books"].Columns["ISBN"],
         objDataSet.Tables["Authors"].Columns["ISBN"]);
   // and add it to the DataSet object's Relations collection
                       //添加关系
   objDataSet.Relations.Add(objRelation);

   // now do the same to link Books and Prices
                       //类似处理另一个关系
   objRelation = new DataRelation("BookPrices",
         objDataSet.Tables["Books"].Columns["ISBN"],
         objDataSet.Tables["Prices"].Columns["ISBN"]);
   objDataSet.Relations.Add(objRelation);
  }
  catch (Exception objError)
  {
   // display error details
   outError.InnerHtml = "<b>* Error while accesing data</b>.<br />"
       + objError.Message + "<br />" + objError.Source;
   // return Nothing on error
   return null;
  }

  // display a success message
  outError.InnerHtml = "DataSet created and loaded.";

  // return our new disconnected DataSet object
  return objDataSet;

 }

 

企业数字化转型AI大模型赋能智能体平台及AI场景应用规划方案(生态合作版).pptx 立即下载

相关推荐

MCGS的Http协议驱动,支持http协议

硬件配置 参数设置 设备属性 设备命令 通讯状态 附录 #HTTP 1、 设备简介 驱动类型 该驱动为独立设备,直接添加构件即可,不需要挂载到父设备下 通讯协议 采用标准HTTP1.1协议 通讯方式 驱动构件为客户端。 2、 硬件连接 本软件在通讯之前,请保证通讯连接正确。通讯连接方式:采用标准的RJ45接口的以太网接线(对调网线或使用HUB交换)。 3、 设备通讯参数 本设备为独立设备,无父设备参数 4、 设备构件参数设置 “HTTP设备”参数设置如下: <1> 内部属性: 构建url信息。 <2> 最小采集周期:本软件对设备进行操作的时间周期,单位为ms,默认为100ms。 <3> 通讯等待时间:通讯数据接收等待时间,默认设置为200ms,当采集速度要求较高或数据量较大时,设置值可适当减小或增大。 <4> HttpHead:http head添加需要的字段,不需要添加http head时值为空,默认不添加。 5、 设备命令 本设备构件提供设备命令,用于进行相应的操作,设备命令的格式如下: 设备命令 命令介绍 GetHttpHead 格式1 GetHttpHead(headStr) 用途 获取http head参数 参数 headStr 参数可以为字符型变量、字符串常量 例1 !SetDevice(设备0,6,"GetHttpHead(headStr)") 获取http head数据保存到headStr中 SetHttpHead 格式1 SetHttpHead(headStr) 用途 设置http head参数 参数 headStr 参数可以为字符型变量、字符串常量

BrandBoost WordPress Theme Review: Fast Agency Web Architecture

【代码】BrandBoost WordPress Theme Review: Fast Agency Web Architecture。

2601_96579847的博客 267

WSL2下用QEMU模拟ARM开发板:从编译uboot到调试全流程(附常见错误解决)

本文详细介绍了在WSL2环境下使用QEMU模拟ARM开发板的完整流程,包括uboot编译、内核调试等关键步骤。通过QEMU模拟vexpress-a9开发板,开发者可以高效搭建嵌入式开发环境,解决常见错误并提升开发效率。

solidity8miner的博客 289

HTML控件用法

htmlGeneric:(只有此控件的TagName可以修改)Generic Control ContenthtmlAnchor :My Anchor ControlhtmlImage:htmlForm:...注:若使用HtmlInputFile或必须对enctype属性进行设置以允许文件能上传到服务器htmlButton:My HTML Button注:此控件与不同的是h

AllenTing的专栏 6457

linux下docker 部署onlyoffice社区版

Onlyoffice 是一款功能丰富的在线 Office 工具,类似 WPS 和 微软的 Office 套件。OnlyOffice Workspace 是由 OnlyOffice 推出的基于云计算的企业级在线协作办公平台,由文档服务(Document Server)、控制面板(Control Panel)、社区服务(Community Server)和邮件服务(Mail Server)四个组件构成,提供了文档、项目、成员、邮件等功能模块,支持文档多人协作、历史版本控制等功能,旨在帮助用户提高工作效率和工作质

axiaowua的博客 2382

手把手教你用Keil5和Proteus8给51单片机跑个流水灯(附完整源码+安装包)

本文详细介绍了如何使用Keil5和Proteus8为51单片机实现流水灯效果,包括开发环境配置、汇编代码编写、电路设计及仿真调试。通过完整的源码和安装包,帮助初学者快速掌握C51单片机开发的核心流程,适合嵌入式开发入门学习。

weixin_42632434的博客 375

datalist的数据绑定事件

     OnItemDataBound="CheckTitle">//OnItemDataBound事件发生在各行被绑定到源数据时被调用            Some of the Latest Wrox Press Books                                      Text= />      * ISBN:        Publish

AllenTing的专栏 3946

Python海康摄像头SDK二次开发

摘要:为解决海康威视摄像头RTSP拉流延迟严重的问题,本文提出改用海康私有SDK直接取流的方案。通过下载海康设备网络SDK并调用其Python接口,实现了低延迟的视频流获取。文中详细介绍了SDK配置流程,并提供了优化版的Python代码示例,重点解决回调函数处理、队列缓冲和CPU占用等问题。测试结果表明,该方案显著降低了延迟,同时保持了较高的帧率(30FPS以上)和较低的CPU占用率(约2%)。相较于传统OpenCV+FFmpeg的RTSP方案,海康SDK直接取流在实时性方面具有明显优势。

xiaohouzi112233的博客 2609

Datalist选择和编辑数据

         CellSpacing = "2"       SelectedItemStyle-BackColor="red"       SelectedItemStyle-ForeColor="white"       EditItemStyle-BackColor="yellow"       EditItemStyle-ForeColor="black"       DataKe

AllenTing的专栏 3493

【NVIDIA-GB200-1】国内第一份生产环境实战安装配置教程,配置安装脚本,nvidia gb200配置教程-复制即用;gb200驱动安装

GB200 的高性能通信依赖。

jundao1997的专栏 707

C++-ONNX:用onnxruntime部署自己的模型【Pytorch导出.onnx】【Tensorflow导出.onnx】【C++用onnxruntime框架部署并推理】

微软联合Facebook等在2017年搞了个深度学习以及机器学习模型的格式标准–ONNX,旨在将所有模型格式统一为一致,更方便地实现模型部署。现在大多数的深度学习框架都支持ONNX模型转出并提供相应的导出接口。ONNXRuntime(Open Neural Network Exchange)是微软推出的一款针对ONNX模型格式的推理框架,用户可以非常便利的用其运行一个onnx模型。ONNXRuntime支持多种运行后端包括CPU,GPU,TensorRT,DML等。

u013250861的博客 5766

datagrid行排序和筛选

  Select only Titles containing the text:             EnableViewState="False"       CellPadding="5"       GridLines="None"       HeaderStyle-BackColor="silver"       HeaderStyle-HorizontalAlign="c

AllenTing的专栏 2847

SAP CPI 如何代理第三方接口?

代理接口是指在系统 A 和系统 B 之间引入一个中间层(如 SAP CPI),由中间层负责接收来自系统 A 的请求,进行必要的处理或转换,然后将请求转发给系统 B。由于 OData 服务通常使用 JSON 格式的数据,而某些内部系统可能需要 XML 格式,因此我们添加一个 JSON 到 XML 的转换器,以确保数据格式的兼容性。为了确保返回的数据格式符合内部系统的要求,添加一个 XML 到 JSON 的转换器,将 OData 服务的响应从 XML 转换为 JSON。在集成包中,添加一个新的集成流,命名为。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1750

datagrid自动分页

aspx页面:   Previous Link Text:       Next Link Text:      Paging Style:                       runat="server" /> Numeric                         runat="server" /> Text   Number of r

AllenTing的专栏 2599

2026华为OD机试(Python)真题【E卷+A卷+B卷+C卷+D卷】目录+在线OJ

华为OD机试真题题库【E卷+A卷+B卷+C卷+D卷】目录,Python实现。

MISAYAONE的博客 29万+

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

利用datagrid编辑数据

         CellPadding = "2"       EditItemStyle-BackColor="yellow"       DataKeyField="ISBN"//后面可以使用DataKeys集合的行索引来获取该行的ISBN栏的值       OnEditCommand="DoItemEdit"//Edit事件处理       OnUpdateCommand="DoIte

AllenTing的专栏 2098

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

第三天

谈谈用户控件的用法:简单说,一个用户控件的获得最简单的方式是把一个aspx文件后缀改为ascx并把中Page改为Control 指令即可.具体举个例子://注意此处  public void Page_Load(Object Source, EventArgs E)  {    if (!IsPostBack)    {      SqlConnection myConnection;  

AllenTing的专栏 1844

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

datagrid的自定义和隐藏栏

                   AutoPostback="True" /> Visible                       AutoPostback="True" /> Hidden         AutoGenerateColumns="False"   //注意这儿       CellPadding="5"       GridLines="None"  

AllenTing的专栏 1755

web 控件用法

 asp:CheckBox:asp:RadioButton:GroupName="aaa" runat="server"/>注:属性GroupName与htmlinputRadioButton控件的name属性等同!!asp:HyperLink:runat="server"/>注:1 此控件的NavigateUrl和Target属性的区别???2 另可以添加name属性例:接着在该页面

AllenTing的专栏 1583

第一天

     Day   1                                                         初识ASP.NET     State:                 此处有一个标有runat="server"属性的表单,这表示告诉ASP.NET改表单将返回数据以便在服务器代码中使用.在表单中DropDownList(等同于HTML SELECT列表),

AllenTing的专栏 1483

修改web.config文件(程序方式)

namespace ConsoleApplication1{ class Class1 {  [STAThread]  static void Main(string[] args)  {   ManagementObject appSet= new ManagementObject("root//NetFrameworkV1:appSettings.Directive=/"add/",key=/

AllenTing的专栏 1476

第二天

POSTBACK的问题:  Page的IsPostBack属性用来解决此问题.由于Page_Load在每次页面加载时运行,其中的代码即使在回送(PostBack)的情况下也会执行.这在一般情况下不需要或者不允许的.页面处理步骤:  1 服务器往返:   服务器负责动态创建页面并把页面传递给客户端.而客户端负责给出信息和从用户那里获取信息,同时有选择的执行某个客户端脚本.在asp.net

AllenTing的专栏 1454

Adding Primary Keys and Foreign Keys to a Table

 void Page_Load(Object sender, EventArgs e) {  // get connection string from ../global/connect-strings.ascx user control  string strConnect = ctlConnectStrings.OLEDBConnectionString;  outConnect.I

AllenTing的专栏 1439

验证控件

验证控件主要有以下6种:1234 5 //此控件最灵活6注:验证可以在服务端,客户端以及两者都可以进行验证,关键是使用时机.具体用法见例://用于客户端验证一个数是否是素数// client-side validation function for CustomValidatorfunction ClientValidate(objSource, objArgs) {var blnValid =

AllenTing的专栏 1415
上一篇: (MS SQL Server)SQL语句导入导出大全
下一篇: Adding Expressions, Default Values and Constraints to a Table
AllenTing
博客等级 码龄22年 2粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值