G
Guest
check the InternalTicks for the date1 and date and see what I mean. What the
hell?
string connString = "Data Source=(local);Initial Catalog=Test;Integrated
Security=True";
SqlCommand command = new SqlCommand("insert into Table_1
(CreateDate) values (@date)");
DateTime date1 = DateTime.Now;
command.Parameters.AddWithValue("@date", date1);
command.Connection = new SqlConnection(connString);
command.Connection.Open();
command.ExecuteNonQuery();
command.CommandText = "Select * from Table_1";
SqlDataReader reader = command.ExecuteReader();
reader.Read();
DateTime date = (DateTime)reader["CreateDate"];
reader.Close();
command.CommandText = "Delete from Table_1";
command.ExecuteNonQuery();
command.Connection.Close();
hell?
string connString = "Data Source=(local);Initial Catalog=Test;Integrated
Security=True";
SqlCommand command = new SqlCommand("insert into Table_1
(CreateDate) values (@date)");
DateTime date1 = DateTime.Now;
command.Parameters.AddWithValue("@date", date1);
command.Connection = new SqlConnection(connString);
command.Connection.Open();
command.ExecuteNonQuery();
command.CommandText = "Select * from Table_1";
SqlDataReader reader = command.ExecuteReader();
reader.Read();
DateTime date = (DateTime)reader["CreateDate"];
reader.Close();
command.CommandText = "Delete from Table_1";
command.ExecuteNonQuery();
command.Connection.Close();