here iam storing selected value of dropdown into variable of type 'TimeSpan' and saving in database. But it gives exception: 'String was not recognized as a valid TimeSpan.' my database fieldtype is also Time(7)
DateTime start_time = DateTime.ParseExact(starttime.SelectedItem.Text, "hh:mm tt", CultureInfo.InvariantCulture);
TimeSpan stt = start_time.TimeOfDay;
SqlCommand com = new SqlCommand("INSERT INTO IvrDatas starttime values @starttime",conn);
com.Parameters.AddWithValue("@starttime", stt)
Please help me out in this matter.