VB.NET Example Dim FirstDate As Date Dim SecondDate As Date Dim days As Integer Dim hours As Integer Dim minutes As Integer 'Your DatePicker control would capture these dates FirstDate = Now() 'I add 3 days just for example sake SecondDate = DateAdd(DateInterval.Day, 3, FirstDate) 'Use datediff to calculate in days, then hours, then minutes days = DateDiff(DateInterval.Day, FirstDate, SecondDate) hours = DateDiff(DateInterval.Hour, FirstDate, SecondDate) minutes = DateDiff(DateInterval.Minute, FirstDate, SecondDate) Hope this helps Gregory J Lynch Hack
greg lynch _nj_
Posts
-
How to find out how many days? -
Menu Itemcan I reference the name property of a menu item. I cannot find it anywhere Gregory J Lynch Hack
-
One thing that Trobles me in VB.NETI have been working with VB.NET for a few months coming from vb 4 5 and 6. I have enjoyed the control that I have over the execution on my programs and the level of detail available throught he framework. However, I seem to have a thorn in my side whenever I utilize the datagrid. Indexoutofrange exception seems to pop up out of knowhere and for the life of me I can not properly trap it or handle it in debug mode. I have gotten around other exceptions, has anyone else experienced this? is there something that I would be overlooking or a way to trap. Thanks Gregory J Lynch Hack
-
SQL queryI believe this may be the solution --Declare the Necessary Variables DECLARE @ID AS int, @Name AS nvarChar(15), @Nick AS nvarChar(15) --Incorporate those Variables --Into the Select Statement SELECT @ID = id, @Name = name, @Nick = nick FROM blahtable WHERE salary = 2000 PRINT @ID PRINT @Name PRINT @Nick Buy the Book 'Advanced Transact-SQL for SQL Server 2000' by Itzak Bengan and Tom Moreau, If you plan on working with SQL, it will change your life ...just kidding but its a powerfull book Gregory J Lynch Hack
-
First visible Row in DataGridHello, Does Anyone know how to find the index of the First Visible Row in the .NET Datagrid would help, thanks Gregory J Lynch Hack