Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can someone help me, I want to display and see those expiry date from date today in data grid view.

If 2 months before expiry, display in yellow background
If 1 month before expiry, display in red background

in a cell which has expiry date in column of my table.
I use MSACCESS as database.

What I have tried:

Dim str As String = "SELECT * FROM TblDocuments WHERE ExpiryDate = (DateAdd(month,-1,getdate())"
Dim DaAp1 As New SqlDataAdapter(str, con)
Dim Dset1 As New DataTable
DaAp1.Fill(Dset1)
DGV1.DataSource = Dset
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900