c# - How to get Datetimepicker with seconds in asp.net? -
I have a job on which I have to filter the records by date and date. The date from 'MySQL' is like '2014-07-18 20:03:08'. At the front end, I used DatetimePicker in the text box..Detmatomicor format returns '2014/07/09 14:00'. Therefore, it is not possible to compare DB's dateform and datetime format.
I want a dead time picker with a second .. help me
The Datatimepicker format returns '2014/07/09 14:00'. Use columns in datetime-MySQL instead of using SQL-Parameters and pass directly to DateTime Picture stores a
datetime in the
value property. You can add the necessary seconds for it:
DateFrom.Value = DateFrom.Value.AddSeconds (seconds);
DateTime :
// If you want to add seconds, but I do not see any reason for this / maybe you want to add to-date, you can add one day - a second date. Value = date Value Adwords (1) .endsconds (-1); (MySqlConnection conn = Using the new MySqlConnection ("connStr")) {try {conn.Open ()} string sql = @ "SELECT t.fr, T.T.O. Is from = =from and from & lt; = @To "; {Cmd.Parameters.AddWithValue ("@ from", DateFrom.Value) using (MySqlCommand cmd = new MySqlCommand (sql, conn)); Cmd.Parameters.AddWithValue ("@ to", DateTo.Value); (While using MySqlDataReader Reader = cmd.ExecuteReader ()) {while reader.Read ()) {// ...}}}} hold (exception pre) {Console.WriteLine (ex.ToString ()); }}
Comments
Post a Comment