Dim i As Integer
For i = 0 To MachineDataSet.Machines.Rows.Count - 1
dgvPdMc.Columns.Add(MachineDataSet.Machines.Rows(i).Item(0), MachineDataSet.Machines.Rows(i).Item(0))
dgvPdMc.Columns(i).Tag = MachineDataSet.Machines(i).Item(0)
Next
For i = 0 To ProductDataSet.Pipes.Count - 1
dgvPdMc.Rows.Add()
dgvPdMc.Rows(i).HeaderCell.Value = ProductDataSet.Pipes(i).Item(2)
dgvPdMc.Rows(i).Tag = ProductDataSet.Pipes(i).Item(2)
Next
Tag : .NET, Ms SQL Server 2008, Win (Windows App), VB.NET