narasiman man

narasiman man

  • NA
  • 0
  • 118.3k

hours calculation

Feb 26 2012 10:43 AM


CODE:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DateTime a = Convert.ToDateTime(TextBox1.Text);
        DateTime b = Convert.ToDateTime(TextBox2.Text);
        TimeSpan ts  = b.Subtract(a);
        TextBox3.Text = ts.Hours.ToString().Trim();
    
    }
   
}


DESIGN:
 

  


i send the design and code.
total time is not working
it shows the error message

String was not recognized as a valid DateTime.


please help me and shows the correct output

thanks.....




Answers (1)