Click here to Skip to main content
14,869,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys

I have a custom datagridview each column is a day of the month.
My database is :
ImproID INT, Improve NVARCHAR, Active BIT, Idate DATETIME.
I want if ACTIVE VALUE is TRUE in specific day to load an image.
How can i do it? This is the code for datagridview:
Private Sub createcal(days As String)
        Dim day As Integer = Convert.ToInt32(days)
        Dim i As Integer
        For i = 1 To day
            Dim seldate As String = (i) & " " & selectedmonth & " " & selectedyear
            Dim myDateTime As DateTime = Convert.ToDateTime(seldate)
            Dim dayname As String = Nothing
            Dim dt As String = myDateTime.ToString("dd-MM-yyyy")
            dayname = String.Format("{0:ddd}", Convert.ToDateTime(dt))
            dayname = (System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DayNames(CInt(myDateTime.DayOfWeek)))
            dayname = (dayname.Substring(0, 3))
            Dim mapColumn As New DataGridViewTextBoxColumn
            mapColumn.Name = "mapColumn"
            mapColumn.ValueType = GetType(Date)
            mapColumn.HeaderText = dayname & " " & i.ToString()
            mapColumn.Width = 35
End Sub

Can someone help PLEASE.

Thanks in advance
Updated 12-Oct-14 3:16am
[no name] 9-Oct-14 11:44am
It's not clear to this point "More specific a datetime
column of the database.". make clear what you need
[no name] 12-Oct-14 9:27am
So what is the problem? You are not querying any database here, not loading any image for anything or attempting to set any image to your custom datagridview. So what, exactly, does this code have to do with your question?
jomachi 12-Oct-14 9:33am
That is the point, I want the code to load the image if ACTIVE VALUE is TRUE
[no name] 12-Oct-14 9:40am
Okay so go write the code. No one here is going to write it for you.

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