Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Insert Int/DateTime Format into a specific cell of DataTable (Difference BetweenDays)

$
0
0
                So I'm trying to Getthe difference between 2 dates as an Int and add the int to thedatatable,  I'm pretty sure the error is in the final line, since instead of executing this line, the code just breaks out of the loop. Is is asyntax error I'm missing or is there a method to this madness?

Here's what I'm working with.

   
 DateTime StartHold = Convert.ToDateTime(GetStart.ExecuteScalar());    DateTime EndHold = Convert.ToDateTime(GetEnd.ExecuteScalar());    NewLine["TotalDays"] = DateTime.Parse(EndHold.ToString()).Date - DateTime.Parse(StartHold.ToString()).Date;



Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>