Private Sub PopulateData()
DBClass.DBServer = DBPath
Dim DBClass As New clsDB.clsDatabase
MsgBox(LOG.WriteErrLog(0,
Exit SubEnd IfWith dsBlock_Ext.Tables(0)Columns.Add("Car Park Access Rights"If .Rows.Count > 0 ThenReDim aStfNo(.Rows.Count - 1)ReDim aCardNo(.Rows.Count - 1)For icnt As Integer = 0 To .Rows.Count - 1 For jcnt As Integer = 0 To .Columns.Count - 1If jcnt = 0 Then aCardNo(icnt) = Trim(.Rows(icnt).Item(jcnt)) ElseIf jcnt = 1 Then .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt)) ElseIf jcnt = 2 Then .Rows(icnt).Item(jcnt) = Mid(.Rows(icnt).Item(jcnt), 7, 2) & "/" & _ Mid(.Rows(icnt).Item(jcnt), 5, 2) & "/" & _ Mid(.Rows(icnt).Item(jcnt), 1, 4 .Rows(icnt).Item(jcnt) = GetDoorAccess(Trim(.Rows(icnt).Item(0))) ElseIf jcnt = 3 Then ElseIf jcnt = 4 Then If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt) = Else End If ElseIf jcnt = .Columns.Count - 2 Then If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt + 1) = "" Else .Rows(icnt).Item(jcnt + 1) = GetCPAccess(Trim(.Rows(icnt).Item(0))) End If Else If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt) = "" Else .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt)) End If End If NextNextEnd If.Columns.Remove("SendBit")End WithdgvBlock_Extend.DataSource = dsBlock_Ext.Tables(0)Catch ex As ExceptionLOG.WriteErrLog(0, DBClass.Close()"Block & Extend - Populate Data Grid : " & ex.Message)FinallyEnd TryEnd Subthanx in advance =) .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt))"")
Columns.Add("Car Park Access Rights"
If .Rows.Count > 0 ThenReDim aStfNo(.Rows.Count - 1)ReDim aCardNo(.Rows.Count - 1)For icnt As Integer = 0 To .Rows.Count - 1 For jcnt As Integer = 0 To .Columns.Count - 1If jcnt = 0 Then aCardNo(icnt) = Trim(.Rows(icnt).Item(jcnt)) ElseIf jcnt = 1 Then .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt)) ElseIf jcnt = 2 Then .Rows(icnt).Item(jcnt) = Mid(.Rows(icnt).Item(jcnt), 7, 2) & "/" & _ Mid(.Rows(icnt).Item(jcnt), 5, 2) & "/" & _ Mid(.Rows(icnt).Item(jcnt), 1, 4 .Rows(icnt).Item(jcnt) = GetDoorAccess(Trim(.Rows(icnt).Item(0))) ElseIf jcnt = 3 Then ElseIf jcnt = 4 Then If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt) = Else End If ElseIf jcnt = .Columns.Count - 2 Then If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt + 1) = "" Else .Rows(icnt).Item(jcnt + 1) = GetCPAccess(Trim(.Rows(icnt).Item(0))) End If Else If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt) = "" Else .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt)) End If End If NextNextEnd If.Columns.Remove("SendBit")End WithdgvBlock_Extend.DataSource = dsBlock_Ext.Tables(0)Catch ex As ExceptionLOG.WriteErrLog(0, DBClass.Close()"Block & Extend - Populate Data Grid : " & ex.Message)FinallyEnd TryEnd Subthanx in advance =) .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt))""
Mid(.Rows(icnt).Item(jcnt), 5, 2) & "/" & _
Mid(.Rows(icnt).Item(jcnt), 1, 4
.Rows(icnt).Item(jcnt) = GetDoorAccess(Trim(.Rows(icnt).Item(0)))
.Rows(icnt).Item(jcnt) =
Else End If ElseIf jcnt = .Columns.Count - 2 Then If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt + 1) = "" Else .Rows(icnt).Item(jcnt + 1) = GetCPAccess(Trim(.Rows(icnt).Item(0))) End If Else If .Rows(icnt).Item(jcnt) Is Convert.DBNull Then .Rows(icnt).Item(jcnt) = "" Else .Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt)) End If End If NextNextEnd If.Columns.Remove("SendBit")End WithdgvBlock_Extend.DataSource = dsBlock_Ext.Tables(0)Catch ex As ExceptionLOG.WriteErrLog(0, DBClass.Close()"Block & Extend - Populate Data Grid : " & ex.Message)FinallyEnd TryEnd Subthanx in advance =)
.Rows(icnt).Item(jcnt + 1) =
.Rows(icnt).Item(jcnt + 1) = GetCPAccess(Trim(.Rows(icnt).Item(0)))
.Rows(icnt).Item(jcnt) = Trim(.Rows(icnt).Item(jcnt))
.Columns.Remove(
dgvBlock_Extend.DataSource = dsBlock_Ext.Tables(0)
LOG.WriteErrLog(0,
DBClass.Close()