Click here to Skip to main content
15,881,803 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Is VB.Net under-rated? Pin
Eddy Vluggen28-Feb-20 9:52
professionalEddy Vluggen28-Feb-20 9:52 
GeneralRe: Is VB.Net under-rated? Pin
ZurdoDev28-Feb-20 10:01
professionalZurdoDev28-Feb-20 10:01 
GeneralRe: Is VB.Net under-rated? Pin
Eddy Vluggen28-Feb-20 10:29
professionalEddy Vluggen28-Feb-20 10:29 
GeneralRe: Is VB.Net under-rated? Pin
jsc4211-Apr-20 9:26
professionaljsc4211-Apr-20 9:26 
GeneralRe: Is VB.Net under-rated? Pin
markrlondon13-Apr-20 11:27
markrlondon13-Apr-20 11:27 
AnswerRe: Is VB.Net under-rated? Pin
Mycroft Holmes28-Feb-20 11:22
professionalMycroft Holmes28-Feb-20 11:22 
GeneralRe: Is VB.Net under-rated? Pin
markrlondon13-Apr-20 11:28
markrlondon13-Apr-20 11:28 
QuestionVB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 2:39
Member 1186689325-Feb-20 2:39 
When I save the attendance date from a datetimepicker as a date prior to today's date it records acceptable format but not what I really want. When I select today's date it records a date like this 2020-02-25 08:28:00.946341400.

The secondary issue is what I eluded to above. I set the custom format in the form_load to "MM, dd, yyyy" and when I select a date prior to today's date it records the date like this 2020-01-29 08:34:25.

Here is the Save Button code

Dim inserted As Integer = 0
       For Each row As DataGridViewRow In dgvAttend.Rows
           Dim isSelected As Boolean = Convert.ToBoolean(row.Cells("chkbox").Value)
           If isSelected Then
               Access.AddParam("@DTE", dtPick5.Value)
               Access.AddParam("@SID", row.Cells("StudentID").Value)
               Access.AddParam("@LN", row.Cells("LastName").Value)
               Access.AddParam("@FN", row.Cells("FirstName").Value)

               Access.ExecQuery("INSERT INTO Attend (TrainDate,StudentID,LastName,FirstName) " &
                        "VALUES (@DTE,@SID,@LN,@FN); ")

               inserted = inserted + 1
           End If
       Next

       If inserted > 0 Then
           MessageBox.Show(String.Format("{0} records inserted.", inserted), "ACJTracker", MessageBoxButtons.OK, MessageBoxIcon.Information)
       End If


Here is the form load

dtPick5.Format = DateTimePickerFormat.Custom
        dtPick5.CustomFormat = "MM, dd, yyyy"
        RefreshAttendGrid()


Here is the refresh Grid

dtPick5.Format = DateTimePickerFormat.Custom
       dtPick5.CustomFormat = "MM, dd, yyyy"

       ' RUN QUERY
       Access.ExecQuery("SELECT StudentData.StudentID, StudentData.LastName, StudentData.FirstName FROM StudentData ORDER BY StudentID ASC")

       ' REPORT & ABORT ON ERRORS
       If NoErrors(True) = False Then Exit Sub

       dgvAttend.DataSource = Access.DBDT


Does anyone know how I correct these issues?
AnswerRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 3:07
mveRichard MacCutchan25-Feb-20 3:07 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 3:18
Member 1186689325-Feb-20 3:18 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 3:33
mveRichard MacCutchan25-Feb-20 3:33 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 3:32
Member 1186689325-Feb-20 3:32 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 3:37
mveRichard MacCutchan25-Feb-20 3:37 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 6:37
Member 1186689325-Feb-20 6:37 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 6:43
mveRichard MacCutchan25-Feb-20 6:43 
GeneralMessage Closed Pin
25-Feb-20 6:55
Member 1186689325-Feb-20 6:55 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Eddy Vluggen25-Feb-20 8:02
professionalEddy Vluggen25-Feb-20 8:02 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
phil.o25-Feb-20 8:18
professionalphil.o25-Feb-20 8:18 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 8:18
mveRichard MacCutchan25-Feb-20 8:18 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Eddy Vluggen25-Feb-20 8:44
professionalEddy Vluggen25-Feb-20 8:44 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 8:49
mveRichard MacCutchan25-Feb-20 8:49 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Eddy Vluggen25-Feb-20 12:19
professionalEddy Vluggen25-Feb-20 12:19 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 21:09
mveRichard MacCutchan25-Feb-20 21:09 
QuestionRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
ZurdoDev28-Feb-20 6:55
professionalZurdoDev28-Feb-20 6:55 
AnswerRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
phil.o25-Feb-20 8:24
professionalphil.o25-Feb-20 8:24 

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.