WPF中的XML读取错误 [英] XML reading error in WPF
问题描述
我有一个Windows窗体应用程序,它从XML文件中读取数据,然后使用数据进行一些计算。所有这些在 Windows窗体应用程序中完美地运行。
然后我使用"Expression Blend"为我的应用程序创建了一个很好的UI。和WPF。其中相同的VB代码给出了如下许多错误;
1)。 Dim DS 作为 新 数据集
错误:输入"数据集"未定义
2)。 如果 我的 .Computer.FileSystem.FileExists( " ; C:\ CNST.xml" ) 然后 DS .ReadXml (< font style ="font-size:12px"color ="#a31515"> " C:\ CNST.xml" )
错误:名称"DS"未申报
3)。 Dim A = From R < font style ="font-size:12px"color ="#3333ff"> In DS.Tables(0).Rows 选择 R 其中 R.item(0)喜欢 ComboBox1.Text
错误:名称"DS"未声明"
4)。对于 每个 行 As DataRow 在 A
错误:输入"DataRow"未定义
3)。 textbox_1.Text =( Val ( textbox_2 .Text)+ Val ( textbox_3 .Text))。ToString
错误:名称"Val"未声明
感谢您将我的Windows窗体应用程序转换为WPF的帮助。
1)。 Dim DS 作为 新 数据集
错误:输入"数据集"未定义
您应该尝试 Dim DS As 新 系统。 Data.DataSet或
Imports System.Data
这应该清除未声明的DS
Val函数在我的WPF应用程序中运行良好
我希望这会有所帮助。
I have a Windows Form Application which reads data from a XML file and then do some calculation using the data. All this works perfectly in Windows Form Application.
Then I've created a nice UI for my application using "Expression Blend" and WPF. In which same VB code has given many errors as below;
1). Dim DS As New Dataset
ERROR : Type "Dataset" is not defined
2). If My.Computer.FileSystem.FileExists("C:\CNST.xml") Then DS.ReadXml("C:\CNST.xml")
ERROR : Name "DS" is not declared
3). Dim A = From R In DS.Tables(0).Rows Select R Where R.item(0) Like ComboBox1.Text
ERROR : Name "DS" is not declared"
ERROR : Type "DataRow" is not defined
3). textbox_1.Text = (Val(textbox_2.Text) + Val(textbox_3.Text)).ToString
ERROR : Name "Val" is not declared
Appreciate your help converting my Windows forms Application to WPF.
1). Dim DS As New Dataset
ERROR : Type "Dataset" is not defined
You should try Dim DS As New System.Data.DataSet orImports System.Data
This should clear up the DS not declared
The Val function works fine in my WPF application
I hope this helps.
这篇关于WPF中的XML读取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!