Is there any problem in my codes.
I just want to get the value from my database that the same in my DGV Column.
I didnt get any error, but the column shows nothing.
here is my code.
Code:Dim col2 As New DataGridViewTextBoxColumn col2.DataPropertyName = "PropertyName" col2.HeaderText = "Brand" col2.Name = "Brand" DGVImport.Columns.Add(col2) For rowIndex = 0 To DGVImport.RowCount - 1 Dim previousBalance = DGVImport.Rows(rowIndex).Cells("LicensePlateNo").Value.ToString Dim Brand As String For i = rowIndex To DGVImport.Rows.Count - 1 Dim LoadBrand As String = "Select Brand from TblBrand where PlateNo=@PlateNo" siemdi = New OleDbCommand(LoadBrand, cns) siemdi.Parameters.AddWithValue("@PlateNo", previousBalance) DGVImport.Rows(rowIndex).Cells("Transporter").Value = Brand Next Next




Reply With Quote
