雨笑烟燃

专注于VB.net.关注WPF.

« 解决Debian apt-get update缺少公钥GPG error的问题Sourcegrid.Grid退出编辑模式 »

NDataTable的Load问题

使用CF上的,发现有一个问题,对其更正为:

   1:  Public Sub Load(ByVal bytes As Byte())
   2:              If bytes.Length = 0 Then
   3:                  Exit Sub
   4:              End If
   5:              Try
   6:                  mList.Clear()
   7:                  Dim s As Stream = New MemoryStream(bytes)
   8:                  Dim xmlr As XmlTextReader = New XmlTextReader(s)
   9:                  xmlr.WhitespaceHandling = WhitespaceHandling.None
  10:                  xmlr.MoveToContent()
  11:                  Dim items As DataItems
  12:                  Dim nname As String, nvalue As String, ntype As String = ""
  13:                  xmlr.Read()
  14:                  While (True)
  15:                      If xmlr.LocalName = "ntable" Then
  16:                          Exit While
  17:                      End If
  18:                      xmlr.ReadStartElement("items")
  19:                      items = New DataItems()
  20:                      nname = xmlr.Name()
  21:                      nvalue = xmlr.ReadElementString
  22:                      'ntype=xmlr.reada
  23:                      While (Not xmlr.EOF)
  24:                          items.Add(nname, nvalue)
  25:                          nname = xmlr.Name()
  26:                          If nname = "items" Then Exit While
  27:                          nvalue = xmlr.ReadElementString
  28:                      End While
  29:                      mList.Add(items)
  30:                      xmlr.ReadEndElement()
  31:                  End While
  32:              Catch ex As Exception
  33:                  Exit Try
  34:              End Try
  35:          End Sub
  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Walle Build 100427

Copyright yxyr.com ,Some Rights Reserved.浙ICP备06021833号