Click here to Skip to main content
15,889,266 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questioncan't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 0:36
Meax5-Jul-18 0:36 
AnswerRe: can't connect to finger print scanning device from windows server 2003 Pin
Richard Deeming5-Jul-18 1:38
mveRichard Deeming5-Jul-18 1:38 
GeneralRe: can't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 8:06
Meax5-Jul-18 8:06 
Questionhow to highlight dates of Month Calendar from database windows form Pin
Meax2-Jul-18 20:01
Meax2-Jul-18 20:01 
AnswerRe: how to highlight dates of Month Calendar from database windows form Pin
Richard MacCutchan2-Jul-18 21:08
mveRichard MacCutchan2-Jul-18 21:08 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax2-Jul-18 22:19
Meax2-Jul-18 22:19 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Richard MacCutchan2-Jul-18 22:20
mveRichard MacCutchan2-Jul-18 22:20 
AnswerRe: how to highlight dates of Month Calendar from database windows form Pin
Richard Deeming3-Jul-18 0:48
mveRichard Deeming3-Jul-18 0:48 
Don't use ArrayList; use List<DateTime>.

Don't convert the dates to strings; keep them as DateTime.

Don't loop over the array setting the BoldedDates for each element; just set the BoldedDates to the list of dates.

Don't call .Read before testing whether the data reader has any rows; you're skipping the first row.
VB.NET
Private AllDates As DateTime()

Private Sub GetAllDate()
    'TODO: Load the connection string from the configuration file
    Const connectionString As String = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=192.168.0.8"
    Const sql As String = "SELECT MeetingDate FROM Meetings"
    
    Using connection As New SqlConnection(connectionString)
        connection.Open()
        
        Using command As New SqlCommand(sql, connection)
            Using reader As SqlDataReader = command.ExecuteReader()
                Dim dates As New List(Of DateTime)()
                
                While reader.Read()
                    dates.Add(reader.GetDateTime(0))
                End While
                
                AllDates = dates.ToArray()
            End Using
        End Using
    End Using
End Sub

Private Sub MakeDatesBoldInCalendar()
    MonthCalendar1.BoldedDates = AllDates
End Sub




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax5-Jul-18 0:25
Meax5-Jul-18 0:25 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Mycroft Holmes5-Jul-18 13:00
professionalMycroft Holmes5-Jul-18 13:00 
GeneralRe: how to highlight dates of Month Calendar from database windows form Pin
Meax15-Jul-18 18:18
Meax15-Jul-18 18:18 
Questionhow to create a VB ActiveX interface Pin
Sakthiu1-Jul-18 23:50
Sakthiu1-Jul-18 23:50 
AnswerRe: how to create a VB ActiveX interface Pin
Richard MacCutchan2-Jul-18 0:27
mveRichard MacCutchan2-Jul-18 0:27 
Questionvb.net parsing of string data Pin
dcof26-Jun-18 6:23
dcof26-Jun-18 6:23 
AnswerRe: vb.net parsing of string data Pin
Richard MacCutchan26-Jun-18 6:30
mveRichard MacCutchan26-Jun-18 6:30 
GeneralRe: vb.net parsing of string data Pin
dcof26-Jun-18 7:41
dcof26-Jun-18 7:41 
GeneralRe: vb.net parsing of string data Pin
Richard MacCutchan26-Jun-18 8:40
mveRichard MacCutchan26-Jun-18 8:40 
AnswerRe: vb.net parsing of string data Pin
Richard Deeming26-Jun-18 12:14
mveRichard Deeming26-Jun-18 12:14 
GeneralRe: vb.net parsing of string data Pin
dcof27-Jun-18 10:52
dcof27-Jun-18 10:52 
QuestionHow to call a 'C' program function from VB code ? Pin
Sakthiu26-Jun-18 3:45
Sakthiu26-Jun-18 3:45 
AnswerRe: How to call a 'C' program function from VB code ? Pin
Richard MacCutchan26-Jun-18 6:25
mveRichard MacCutchan26-Jun-18 6:25 
QuestionHow to run .vba program from specific mail box Pin
Member 1388671525-Jun-18 13:02
Member 1388671525-Jun-18 13:02 
AnswerRe: How to run .vba program from specific mail box Pin
Dave Kreskowiak25-Jun-18 17:26
mveDave Kreskowiak25-Jun-18 17:26 
QuestionHow to pass pre-processor directive to sub-projects Pin
mo149225-Jun-18 3:29
mo149225-Jun-18 3:29 
AnswerRe: How to pass pre-processor directive to sub-projects Pin
Dave Kreskowiak25-Jun-18 4:14
mveDave Kreskowiak25-Jun-18 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.