Record Date in Sql Server 2005 while submitting registration form

Posted by Webquestionss under ASP.NET on 11/18/2012 | Points: 10 | Views : 1634 | Status : [Member] | Replies : 1
After user fills the required information how do I capture the date of filling the form on button click?

My insert query is:

con.Open();
SqlCommand command = new SqlCommand("insert into data (UserID,Name,Email,Country,Date,Multiselect,Gender,Pincode)values('" + txtuserid.Text + "','" + txtname.Text + "','" + txtemail.Text + "','" + ddlcountry.SelectedItem.Text + "','" + s1 + "','" + lbmultiselect.Text + "','" + rblgender.Text + "','" + txtpincode.Text + "')", con);
command.ExecuteNonQuery();




Responses

Posted by: Nkkppp on: 11/18/2012 [Member] Starter | Points: 25

Up
0
Down
for Date field just use the DateTime.Now in the button click.

Webquestionss, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response