Dim j As Integer
adapMember = New OleDb.OleDbDataAdapter("select * from Member", dbConnect)
tbMember.Reset()
adapMember.Fill(tbMember, "Member")
For j = 0 To tbMember.Tables("Member").Rows.Count - 1
recMember = tbMember.Tables("Member").Rows(j)
'Dim S As String = recMember("M_Status")
If Trim(recMember("M_Status")) = "1" And recMember("M_Date") < Date.Now Then
DataGridView1.Rows.Add(recMember("M_ID"), recMember("M_Name"), recMember("M_Tel"), "สมาชิก", recMember("M_Date"), recMember("M_Exp_Date"))
Else
DataGridView1.Rows.Add(recMember("M_ID"), recMember("M_Name"), recMember("M_Tel"), "หมดอายุสมาชิก", recMember("M_Date"), recMember("M_Exp_Date"))
DataGridView1.Rows(j).DefaultCellStyle.BackColor = Color.Red
DataGridView1.Rows(j).DefaultCellStyle.ForeColor = Color.White
End If
Next
End Sub
Dim j As Integer
adapMember = New OleDb.OleDbDataAdapter("select * from Member", dbConnect)
tbMember.Reset()
adapMember.Fill(tbMember, "Member")
For j = 0 To tbMember.Tables("Member").Rows.Count - 1
recMember = tbMember.Tables("Member").Rows(j)
'Dim S As String = recMember("M_Status")
If (Trim(recMember("M_Status")) = "1") And (Date.Now > recMember("M_Exp_Date")) Then
DataGridView1.Rows.Add(recMember("M_ID"), recMember("M_Name"), recMember("M_Tel"), "สมาชิก", recMember("M_Date"), recMember("M_Exp_Date"))
Else
DataGridView1.Rows.Add(recMember("M_ID"), recMember("M_Name"), recMember("M_Tel"), "หมดอายุสมาชิก", recMember("M_Date"), recMember("M_Exp_Date"))
DataGridView1.Rows(j).DefaultCellStyle.BackColor = Color.Red
DataGridView1.Rows(j).DefaultCellStyle.ForeColor = Color.White
End If
Next
End Sub