Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何为数据集表中的每一行执行一次?_Vb.net_Foreach - Fatal编程技术网

Vb.net 如何为数据集表中的每一行执行一次?

Vb.net 如何为数据集表中的每一行执行一次?,vb.net,foreach,Vb.net,Foreach,嗨,我正在尝试循环遍历数据集表中的行 我是一名C#开发人员,得到了一个VB项目,所以我正在为下面的每一个项目努力 有人能告诉我下面这行代码有什么问题吗 For Each Row as DataRow in dataset.Tables[0].Rows Do stuff// 提前谢谢。试试这个 For Each dr As DataRow In ds.Tables(0).Rows Next For Each drow As datarow In dataset.tables(0).r

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

我是一名C#开发人员,得到了一个VB项目,所以我正在为下面的每一个项目努力

有人能告诉我下面这行代码有什么问题吗

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

试试这个

For Each dr As DataRow In ds.Tables(0).Rows
Next
For Each drow As datarow In dataset.tables(0).rows
Next

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

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

感谢

我们在VB中使用()和在c中使用[]作为ds.tables(0)中的数据行。行作为String=dr(0)的str1。tostring()下一步使用此站点将c代码转换为VB,如果您更熟悉c,它不是dr.Item(0)。tostring()吗?但是谢谢,如果计时器允许,我也会标记为正确。