Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. problem while converting datetime diff in vb to c#

problem while converting datetime diff in vb to c#

Scheduled Pinned Locked Moved ASP.NET
csharphelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    christefer
    wrote on last edited by
    #1

    hi any body please help me iam converting vb.net code to c# while doing this i got problem near convertion datediff(dateinterval.day,submitted,completed) with ths above code in vb iam getting output in days i.e 23 but in c# iam getting thre output as 23.14:33:01 can anybody resolves it here i used the datetime completed=datetime.today and submitted=datetime.minvalue

    V 1 Reply Last reply
    0
    • C christefer

      hi any body please help me iam converting vb.net code to c# while doing this i got problem near convertion datediff(dateinterval.day,submitted,completed) with ths above code in vb iam getting output in days i.e 23 but in c# iam getting thre output as 23.14:33:01 can anybody resolves it here i used the datetime completed=datetime.today and submitted=datetime.minvalue

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      How u r getting this "23.14:33:01" value, I mean in which variable u are saving it, can u please post the hole code???

      C 1 Reply Last reply
      0
      • V varshavmane

        How u r getting this "23.14:33:01" value, I mean in which variable u are saving it, can u please post the hole code???

        C Offline
        C Offline
        christefer
        wrote on last edited by
        #3

        using System; using System.Data; using System.Configuration; using System.Collections; 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; using System.Data.SqlClient; public partial class ExtEltSetTimeStamp : System.Web.UI.Page { protected void Page_Load(object sender, System.EventArgs e) { label3.Text = " Showing COMPLETED Elements "; if (Session != null) { } else { Response.Redirect("Login.aspx"); } if (!Page.IsPostBack) { GridView1.PageIndex = 0; GridView2.PageIndex = 0; fillgridview(); label2.Text = "1 out of" + GridView1.PageCount; label2.Text = "1 out of" + GridView2.PageCount; GridView2.Visible = false; } } public void fillgridview() { DataSet ds; // DataRow[] dr; try { int y = 0; bool iscompleted = false; DateTime submitted = DateTime.Today; DateTime completed = DateTime.MinValue; TimeSpan ts; //DataTable tbliscompleted = new DataTable(); //DataTable tblinprogress = new DataTable(); //string columnname=""; //ds = clsSqlDataProvider.ExtElement_GetRequisitionTime(Convert.ToInt32(Session["LoginId"].ToString()), "1"); clsSqlDataProvider dp = new clsSqlDataProvider(); ds = dp.ExtElement_GetRequisitionTime(112, "1"); DataTable dtCompleted = new DataTable(); dtCompleted.Columns.Add("Description", System.Type.GetType("System.String")); dtCompleted.Columns.Add("Scope", System.Type.GetType("System.String")); dtCompleted.Columns.Add("GICSCodeDesc", System.Type.GetType("System.String")); dtCompleted.Columns.Add("SubmittedDate", System.Type.GetType("System.DateTime")); dtCompleted.Columns.Add("DcDate", System.Type.GetType("System.DateTime")); dtCompleted.Columns.Add("EADate", System.Type.GetType("System.DateTime")); dtCompleted.Columns.Add("HUDate", System.Type.GetType("System.DateTime")); dtCompleted.Columns.Add("PSDate", System.Type.GetType("System.DateTime")); dtCompleted.Columns.Add("DUDate", System.Type.GetType("System.DateTime"));

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups