2016-11-17 46 views
1

你可以帮我在我的每个循环它只保存我的数据库多次Gridview的第一行。如果我的代码有什么问题,你能帮我吗?提前致谢。对于每个Gridview无法正常工作

这里是我的代码

Using _adTransPlatts As New TradingTransactionRepository 

     For Each row As GridViewRow In 
       GridView1.Rows_adTransPlatts.AddPlatts(GridView1.Rows(0).Cells(1).Text, GridView1.Rows(0).Cells(2).Text, GridView1.Rows(0).Cells(3).Text) 
     Next 
      MsgBox("Completed") 
    End Using 
+0

@Mate谢谢 – jezz

+0

太棒了!添加它作为答案 – Mate

回答

1

变化GridView1.Rows(0)通过currentRow

For Each currentRow As GridViewRow In GridView1.Rows 
     _adTransPlatts.AddPlatts(currentRow.Cells(1).Text, currentRow.Cells(2).Text, currentRow.Cells(3).Text) 
Next 

GridView1.Rows(0)总是指第一行