简体   繁体   English

数据传输到vb.net中的数据集

[英]Data Transfer to a DataSet in vb.net

I have 7 variables and i need to transfer them in a dataset 我有7个变量,我需要将它们转移到数据集中
I have already create the file with extension .xsd and i have already a report file .rdlc I see the Dataset "DataTable"in my rdlc file but i can't see any field 我已经创建了扩展名为.xsd的文件,并且我已经拥有一个报告文件.rdlc,我在rdlc文件中看到了数据集“ DataTable”,但是我看不到任何字段
It gives me error of "No Dataset is Linked to the document" 它给我错误“没有数据集链接到文档”
From the other hand it sees the dataset in the selection dataset !!! 另一方面,它可以看到选择数据集中的数据集!
So at this point I'm completely confused 所以在这一点上我完全感到困惑
Please is there anybody which can assist me? 请有人能帮助我吗?

Using a Dataset seems like overkill (you can use anything that is IEnumerable) but if you just want to add a row in a DataSet using code you simiply create an instance and call the Add Method on the Tables Row collection. 使用数据集似乎有些矫kill过正(您可以使用IEnumerable的任何方法),但是如果您只想使用代码在数据集中添加一行,则可以简单地创建一个实例并在Tables Row集合上调用Add方法。

    Dim ds As TestDS = New TestDS()

    ds.YourTableName.Rows.Add(txtInputA.Text,
                          txtInputB.Text,
                          txtInputC.Text,
                          txtInputD.Text, 
                          txtInputE.Text,
                          txtInputF.Text,
                          txtInputG.Text

                         )

Then you can just add it to the DataSources collection 然后,您可以将其添加到DataSources集合中

    lr.DataSources.Add(new ReportDataSource("Variables", ds))

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

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