Insert it with a parametrised query, and it will sort itself out - as well as being safer (see SQL Injection attack). Google SQLCommand.AddWithValue and use that instead of including the DateTime.Now in your SQL command string.
Member 7217874 wrote:
Can you give an example with entering more than one parameter insertion takes place.
SqlConnection conn = new SqlConnection("your connection string");
SqlCommand cmd = new SqlCommand("INSERT INTO table_name (username, logindate) VALUES (@USERNAME, @DATE)", conn);
cmd.Parameters.AddWithValue("@USERNAME", tbUserName.Text);
cmd.Parameters.AddWithValue("@DATE", DateTime.Now);
int i = cmd.ExecuteNonQuery();