|
Christian Graus wrote: there's no legitimate reason to move your code > 24 hours, unless it was wrong to start with
I can think of several reasons where the date is changed. Our accounts department often changes the date. I changed the date on my PC serval times today, whilst developing date sensitive software, to test different functions.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Well, I guess if someone is writing software ,that's another ting. For accounting to do it, seems strange to me. However, the average user does not, and if you don't do that check, you have to allow people to run your software as long as they run the date back.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can enstore an encrypted day counter in the registry that the program checks everytime it runs, as long as you use a relatively difficult key to crack, the majority of people will not be able to break it. This works best if you go off times used as oppose to if the date has been changed, because people can always wind the clock back before it ends.
There are some great articles on CP about Registry keys and encryption.
|
|
|
|
|
|
Ksuyong wrote: Urgent Question
Every question is important from each one's perspective. Truly urgent questions which need priority and dedicated attention should be diverted to a paid technical support. Discussion forums are intended as a support channel from volunteer experts on their own effort and time and there is no way preempting a support to one query in preference to other is entertained whatsoever.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Very Sorry.
modified on Monday, May 19, 2008 8:37 AM
|
|
|
|
|
Ksuyong wrote: The only thing I wanted to do is solving the problem as soon as possible, so I named the title of my question "Urgent Question".
Please don't do this. It only irritates people and makes them less likely to help you.
|
|
|
|
|
Dear Colin.
Thank you for your advice.
I'm very sorry, so I change my first reply message.
And if it doesn't matter for you, can you help me?
Hope your reply.
Best regards.
|
|
|
|
|
like 15/1/2008 and 30/1/2008 = 15 day
Pleaaaaaaaaase
Ahmed El-Badry
|
|
|
|
|
|
This is not what I mean
I mean Full date like
8/27/2008 - 5/19/2008 = 100 Day
thnx :S
Ahmed El-Badry
|
|
|
|
|
You've already been given the answer. Hell, you were given the exact code you needed to pull this off, twice. If you can't understand what the single line of code was, then you've got to ask a different question explaining that.
|
|
|
|
|
...and I gave you the answer but you don't seem to get it.
You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different?
But hell, I am in good mood today so once again:
dim date1 as date = 8/27/2008<br />
dim date2 as date = 5/19/2008<br />
dim DiffDays as integer<br />
DiffDays = date1.day-date2.day<br />
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Smithers-Jones wrote: do something different
He is poor in understanding things. You should help him understand this in more depth and with clarity.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Msge.Visible = True
Dim date1 As Date = "8/27/2008"
Dim date2 As Date = "5/19/2008"
Dim DiffDays As Integer
DiffDays = date1.Day - date2.Day
Msge.Text = DiffDays
Who got the output of this code is No. 8 days ,This is not true
The difference between the dates is 100 days ,This is what i mean
Thank you for Help
Ahmed El-Badry
|
|
|
|
|
Msge.Visible = True
Dim date1 As Date = "8/27/2008"
Dim date2 As Date = "5/19/2008"
Dim DiffDays As Integer
DiffDays = date1.Day - date2.Day
Msge.Text = DiffDays
Who got the output of this code is No. 8 days ,This is not true
The difference between the dates is 100 days ,This is what i mean
Thank you for Help
Ahmed El-Badry
|
|
|
|
|
I used Visual Basic.Net in VS 2003
Ahmed El-Badry
|
|
|
|
|
Msge.Visible = True
Dim date1 As Date = "8/27/2008"
Dim date2 As Date = "5/19/2008"
Dim DiffDays As Integer
Dim Diffmonth As Integer
Dim Diffyear As Integer
DiffDays = date1.Day - date2.Day
Diffmonth = date1.Month - date2.Month
Diffyear = date1.Year - date2.Year
Msge.Text = DiffDays.ToString + " " + Diffmonth.ToString + " " + Diffyear.ToString
outing 8 days 3 month 0 year
i want convert this to days = 100 days
Ahmed El-Badry
|
|
|
|
|
Ahmed El-Badry wrote: Msge.Visible = True
Dim date1 As Date = "8/27/2008"
Dim date2 As Date = "5/19/2008"
Dim DiffDays As Integer
DiffDays = date1.Day - date2.Day
Msge.Text = DiffDays
Who got the output of this code is No. 8 days ,This is not true
The difference between the dates is 100 days ,This is what i mean
Right you are, sorry, my fault.
Use this code:
Dim date1 As Date
Dim date2 As Date
date1 = "19.5.2008"
date2 = "27.8.2008"
Dim Diff As TimeSpan = date2.Subtract(date1)
MsgBox(Diff.Days)
but still: you asked this question before (more than a year ago).
In your CV you write, that you have fair knowlege of VB.NET. This date-stuff is very basic, usually explained in the first chapters of most beginner books.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
thnx u
Ahmed El-Badry
|
|
|
|
|
Msge.Visible = True
Dim date1 As Date = "8/27/2008"
Dim date2 As Date = "5/19/2008"
Dim DiffDays As Integer
Dim Diffmonth As Integer
Dim Diffyear As Integer
DiffDays = date1.Day - date2.Day
Diffmonth = date1.Month - date2.Month
Diffyear = date1.Year - date2.Year
Msge.Text = DiffDays.ToString + " " + Diffmonth.ToString + " " + Diffyear.ToString
outing 8 days 3 month 0 year
i want convert this to days = 100 days
Ahmed El-Badry
|
|
|
|
|
Hi,
I'm having some trouble trying to figure out a way to break up a textarea into 800 word pages. I want each page to retain its original spacing and the pages should be broken up at word boundaries so that words aren't cut up from page to page. Any suggestions would be great.
Thanks,
John
|
|
|
|
|
I guess you could count the spaces to find 800 words.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi smile.gif
i have the fellowing code for updating the database when its change in data grid
<br />
<br />
While (r < DataGridView1.Rows.Count - 1)<br />
InsertCommand1.Parameters.Clear()<br />
InsertCommand1.CommandText = "UPDATE [Section] SET Capacity =" & DataGridView1.Rows(r).Cells(2).Value & " WHERE SectionID = " & DataGridView1.Rows(r).Cells(1).Value<br />
<br />
InsertCommand1.CommandType = CommandType.Text<br />
InsertCommand1 = InsertCommand1<br />
DataAdapter1.InsertCommand = InsertCommand1<br />
InsertCommand1.ExecuteNonQuery()<br />
DataAdapter1.Update(DataSet1, "Section")<br />
r += 1<br />
End While<br />
it make the update but it give the fellowing error
Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
when i but the fellowing command
Dim CmdB As New OleDb.OleDbCommandBuilder(DataAdapter1)
it give error in update statment
|
|
|
|
|
asha_s wrote: Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
These built in update things suck. However, if you must use them, this error is telling you that you need to specify the update command ( the SQL that does the update )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|