简体   繁体   English

将表添加到数据集

[英]Add table to dataset

Having a problem adding a table to a dataset, watching in debugger I read xml file into datatable all looks fine, when add datatabe to dataset table/dataset ( using dataviewer ) first record looks good remaining records/fields contain a red ! 将表添加到数据集时遇到问题,在调试器中观看时,我将xml文件读入datatable看起来都很好,当将datatabe添加到数据集表/数据集(使用dataviewer)时,第一条记录看起来不错,其余记录/字段包含红色! mark. 标记。

fs = new FileStream(Server.MapPath(GlobalVar.compathver), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
DataTable CommentTable = new DataTable("Comment");
CommentTable.Columns.Add("ID",Type.GetType("System.Int32"));
CommentTable.Columns.Add("Author",Type.GetType("System.String"));
CommentTable.Columns.Add("Date",Type.GetType("System.String"));
CommentTable.Columns.Add("Text", Type.GetType("System.String"));
CommentTable.ReadXml(fs);
dset.Tables.Add(CommentTable);
fs.Close();


<?xml version="1.0" encoding="utf-8"?>
<CommentItems>
  <Comment id="1">
    <ID>1</ID>
    <Author>Billy</Author>
    <Date>05/22/2009</Date>
    <Text>
      Comments about Bills Blog.
    </Text>
  </Comment>
  <Comment id="3">
    <ID>3</ID>
    <Author>Samanth</Author>
    <Date>05/31/2009</Date>
    <Text>
      Comments about Sams Blog.
    </Text>
  </Comment>
  <Comment id="4">
    <ID>4</ID>
    <Author>BillBoy</Author>
    <Date>06/22/2009</Date>
    <Text>
      Comments about Bills Blog.
    </Text>
  </Comment>
  <Comment id="4">
    <ID>4</ID>
    <Author>Bill</Author>
    <Date>05/21/2009</Date>
    <Text>
      Comments about Lees Blog.
    </Text>
  </Comment>
  <Comment id="3">
    <ID>3</ID>
    <Author>Bill</Author>
    <Date>6/3/2009 2:29:54 PM</Date>
    <Text>Bill's comment</Text>
  </Comment>
  <Comment id="4">
    <ID>4</ID>
    <Author>Bill</Author>
    <Date>05/25/2009</Date>
    <Text>
      Comments about Not Not Not Bills Blog.
    </Text>
  </Comment>
</CommentItems>

Issue is this 问题是这个

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=362994 https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=362994

When using the Dataset Visualiser to display a Dataset with multiple tables error providers are seen instead of the expected data when switching tables. 使用数据集可视化工具显示具有多个表的数据集时,在切换表时会看到错误提供程序,而不是预期的数据。

The initial table displays correctly. 初始表正确显示。 After switching to another table only the first line of data is displayed. 切换到另一个表后,仅显示第一行数据。 every other line has an error provider with the error 'Debugger busy. 每隔一行就有一个错误提供程序,错误为“调试器忙”。 Can't get value'. 无法获得价值”。

This behaviour has been seen on multiple PCs since installing Service Pack 1 for VS2008. 自从为VS2008安装Service Pack 1后,已经在多台PC上看到了此行为。

If the window is resized so that the visualizer grid is not visble when the table is changed then the data is shown correctly.CommentsThanks for your feedback. 如果调整了窗口的大小,以便在更改表格时看不到可视化工具网格,那么数据将正确显示。注释感谢您的反馈。 We are escalating this bug to the product unit who works on that specific feature area. 我们将此错误升级到负责该特定功能区域的产品部门。 The team will review this issue and make a decision on whether they will fix it or not for the next release. 团队将审查此问题,并决定是否为下一版本修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM