0
Answer

OnInserting

A M

A M

18y
2k
1
I have a form with a DetailsView to insert new records in my Access database. I want it to automaticly create a date and time and insert it when a new record is created. But I can't get the function OnInserting to work. I have a SqlDataSourceCommandEventArgs in my code behind file byt I cant get any date.

protected void DetailsView1_ItemInserting(Object sender, SqlDataSourceCommandEventArgs e)

{

e.Command.Parameters["@mydate"].Value = DateTime.Now;

}