my output is 87:02 hours 87 minutes 2
using (SqlConnection conn = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT CONVERT(VARCHAR(10),InTime,108 ), CONVERT(VARCHAR(10),outTime,108 ) FROM aten WHERE Id = '" + txtid.Text + "' and date between '" + Session["fromdate"].ToString() + "' and '" + Session["todate"].ToString() + "'", conn))
{
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
TimeSpan i = new TimeSpan(0, 0, 0);
while (sdr.Read())
{
DateTime inTime = Convert.ToDateTime(sdr[0].ToString(), new CultureInfo("en-Gb"));
DateTime outTime = Convert.ToDateTime(sdr[1].ToString(), new CultureInfo("en-Gb"));
i += outTime.Subtract(inTime);
double hours = i.Hours + (i.Days * 24);
string time = string.Format("{0} : {1}", hours, i.Minutes);
this.txthourswrk.Text = time;
}
conn.Close();
}
}
but i need outtput like this 87:02 minutes