I have this piece of code that is going to save records in my application. I found that the "create_date" has to be format in this way:
"Create_Date": string; required; must validate as a 'DateTime value'. Suggest format: '2012-10-08 02:49:15 AM'
How do you make r1["Create_Date"] = "getdate()"; in the suggested format?
Suggestions are very much appreciated!
"Create_Date": string; required; must validate as a 'DateTime value'. Suggest format: '2012-10-08 02:49:15 AM'
How do you make r1["Create_Date"] = "getdate()"; in the suggested format?
Code:
if (Form1.Rows.Count > 0)
{
DataRow r1 = dt1.NewRow();
r1["Clerk_ID"] = Convert.ToInt32(dtDataForm1.Rows[0]["Clerk_ID"]);
r1["County"] = dtDataForm1.Rows[0]["County"].ToString();
r1["Month"] = Convert.ToInt32(dtDataForm1.Rows[0]["month"]);
r1["Year"] = Convert.ToInt32(dtDataForm1.Rows[0]["year"]);
r1["Create_User"] = "suser_sname()";
r1["Create_Date"] = "getdate()";
r1["Modify_User"] = "";
r1["Modify_Date"] = "";
dt1.Rows.Add(r1);
}
Suggestions are very much appreciated!