Question MySql Array parsing issues

1c3c0ld

New member
Joined
Oct 16, 2010
Messages
2
Programming Experience
1-3
Hello Folks,

I think this is a simple question, but yet im to stupid to answer.
I want some bolded dates in my monthcalender, and that works fine except I'm only getting the first date and the last date from the Mysql table highlighted/bolded in the monthcalender

instead of the mysql reader jumping to the next date in the table and bolding it in the calender


Please observe the code below:

especially this part

For Each currentDate As DateTime In MonthCalendar1.BoldedDates
boldDates(i) = System.DateTime.Parse(SQLdr("Date"))
boldDates(i) = currentDate
i = +1
Next


VB.NET:
    Public Sub fillcalender()
        Dim boldDates As System.DateTime() = New System.DateTime(MonthCalendar1.BoldedDates.Length + 100) {}
        Dim i As Integer
        Dim connection As MySqlConnection
        Dim SQLCmd As New MySqlCommand()
        Dim SQLstr As String
        Dim SQLdr As MySqlDataReader

        connection = New MySqlConnection()

        connection.ConnectionString = "Server=db4free.net; Uid=*****; Pwd=******; Database=dag_eval;"
        Try

            connection.Open()
            SQLstr = "SELECT * FROM Dag_eval"
            SQLCmd.Connection = connection
            SQLCmd.CommandText = SQLstr 'Sets the SQL String
            SQLdr = SQLCmd.ExecuteReader 'Gets Data
            While SQLdr.Read() 'While Data is Present
            For Each currentDate As DateTime In MonthCalendar1.BoldedDates
                boldDates(i) = System.DateTime.Parse(SQLdr("Date"))
                boldDates(i) = currentDate
                i = +1
            Next

            boldDates(i) = System.DateTime.Parse(SQLdr("Date"))
            MonthCalendar1.BoldedDates = boldDates
            SQLCmd.ExecuteNonQuery()
            end While
            connection.Close()
            connection.Dispose()

        Catch mysql_error As MySqlException
            MsgBox("Error : " + mysql_error.Message)
        Finally
            connection.Dispose()
        End Try
    End Sub

I think its putting a +1 some where, but i cannot seem to get it right
PLEASE HELP
 
Last edited:
guess im not that stupid after all, found my awnser
MonthCalendar1.AddBoldedDate(DateTime.Parse(SQLdr("Date"))) replaces MonthCalendar1.BoldedDates = boldDates
hope this topic helps others

Bb
 
Last edited:
Back
Top