Results 1 to 6 of 6

Thread: [2.0] Date Format

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    240

    [2.0] Date Format

    I don't really understand why this code doesn't work?

    Code:
    dr.BeginEdit();
                    dr["ACSDate"] = hdnField.Value;
                    dr["FormNum"] = txtFormNumberNew.Text;
                    dr["ResponsiblePerson"] = txtResponsiblePersonNew.Text;
                    dr["SiteCodeID"] = GlobalVariable.g_sitecodeID;
                    dr.EndEdit();
    
                    da.Update(ds, "tblAsset");
                    ds.AcceptChanges();
    The error says,

    Incorrect date value: '5/30/2007 7:07:13 PM' for column 'ACSDate' at row 1
    The value of hdnField.Value was taken in this code:

    Code:
    DateTime timeNow = DateTime.Now;
            string myTime = timeNow.ToString("h:mm:ss tt");
            string acsdate = ddlMonth.SelectedValue + "/" + ddlDays.SelectedValue + "/" + ddlYear.SelectedValue + " " + myTime;
            hdnField.Value = acsdate;
    What I am using is ASP.net using C# and my database is MySQL AB Database.
    Last edited by jsc0624; May 30th, 2007 at 06:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width