Re: Problem inserting dates to SQL Server

Tech-Archive recommends: Fix windows errors by optimizing your registry



Tom,

Please illustrate what you said.

Anyway, I got a simple solution. I changed the format of
DateTimePicker to dd-MMM-yyyy and used following code:

================================================================
Int32 myRes = ModRes.InsertNewRecord("Insert into TestDate values ('"
+ dateTimePicker1.Text + "')");
================================================================

It worked. If possible, please also show how to use parameterized
command.

.



Relevant Pages

  • Re: Combo box date format changes when item selected from list
    ... Doug Steele, Microsoft Access MVP ... (no private e-mails, please) ... set the Format property of the combo box to dd-mmm-yyyy ...
    (microsoft.public.access.forms)
  • Re: Combo box date format changes when item selected from list
    ... Sounds as though your combo box is bound to a field in the form's underlying ... The combo box format setting is dd-mmm-yyyy. ... When an item in the list is selected the result display in the Combo box ...
    (microsoft.public.access.forms)
  • Re: Date format problems
    ... If I format the date cell to a general number and reformat ... dd/mmm/yyy to dd-mmm-yyyy which it should do. ...
    (microsoft.public.excel.misc)
  • Re: Custome control from DateTime format string
    ... the format string. ... The below code replaces the DateTimePicker with a button which is replaced by the original DateTimePicker pointed to in the Tag element when hit. ... public static void DateTimePicker2Button(DateTimePicker dtp) ... internal static void dtp_button_Click ...
    (microsoft.public.dotnet.languages.csharp)
  • Combo box date format changes when item selected from list
    ... The combo box format setting is dd-mmm-yyyy. ... The computer short date setting is dd/mm/yy. ...
    (microsoft.public.access.forms)