vb.net 如何为数据集表中的每一行做一个?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17524885/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 16:58:55  来源:igfitidea点击:

How to do a for each for the rows in a datasets table?

vb.netforeach

提问by Pomster

Hi I am trying to loop though the rows in a table of my dataset.

嗨,我正在尝试遍历数据集表中的行。

I am a C# developer and have been given a VB project so i am struggling with the For each below.

我是一名 C# 开发人员,并且已经获得了一个 VB 项目,所以我正在为下面的每个人苦苦挣扎。

Could someone please tell me what is wrong with the line of code below?

有人可以告诉我下面的代码行有什么问题吗?

 For Each Row as DataRow in dataset.Tables[0].Rows
    Do stuff//

Thanks in advance.

提前致谢。

回答by Md. Parvez Alam

For Each dr As DataRow In ds.Tables(0).Rows
Next

回答by Debajit Mukhopadhyay

try this

尝试这个

For Each drow As datarow In dataset.tables(0).rows
Next

回答by Manoj

Well, you can convert your C# code to VB.NET using below URL . This could help you

好吧,您可以使用以下 URL 将您的 C# 代码转换为 VB.NET。这可以帮助你

http://www.developerfusion.com/tools/convert/csharp-to-vb/

Thanks

谢谢