1
I have here a column in a Datagridview with the name "DBO" (date of Birth) which has the format month/day/year, I wanted to change the style of the date to dd-MM-yyyy but I’m not getting it.
myCommand = "UPDATE DoctorBasic SET " & _
"DOB = '" & Convert_Null(DGV1(9, 0).Value.ToString("dd/MM/yyyy"), #1/1/1900#)** & "' " & _
"WHERE DoctorId = " & DGV1(0, 0).Value
cmd = New SqlCommand(myCommand, myConnectionString)
MsgBox(myCommand)
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
convert_null is used to display this date 1/1/1900 as default if the entry you are looking for has no date and you want to save some changes to avoid error because the field is null.
as this the grid?
– Tomaz Neto
And what’s the problem?
– Maniero
It seems to me that you are trying to update the date in the database so that it is shown with the desired format on the screen. If this is the case, this is not how it is done. You should format).
– Caffé
Yes from what I understood, that’s what I want. I want you to present yourself in this format so that I can update the date without problems. How can I do it then?
– Mara Pimentel