Click here to Skip to main content
15,913,836 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question"Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile17-Jun-09 23:05
ChiSmile17-Jun-09 23:05 
AnswerRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
0x3c017-Jun-09 23:42
0x3c017-Jun-09 23:42 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile18-Jun-09 1:58
ChiSmile18-Jun-09 1:58 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Luc Pattyn18-Jun-09 2:08
sitebuilderLuc Pattyn18-Jun-09 2:08 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile18-Jun-09 4:11
ChiSmile18-Jun-09 4:11 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Luc Pattyn18-Jun-09 4:33
sitebuilderLuc Pattyn18-Jun-09 4:33 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Pete O'Hanlon18-Jun-09 2:23
mvePete O'Hanlon18-Jun-09 2:23 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
led mike19-Jun-09 5:28
led mike19-Jun-09 5:28 
QuestionCreating primary key constraints on a table using VB.NET Pin
sivakumar.mariappan17-Jun-09 21:05
sivakumar.mariappan17-Jun-09 21:05 
AnswerRe: Please Ignore [Cross Post] Pin
Aman Bhullar18-Jun-09 2:37
Aman Bhullar18-Jun-09 2:37 
QuestionHow many primary key constraints can we have in a table of ms-access? Pin
sivakumar.mariappan17-Jun-09 20:57
sivakumar.mariappan17-Jun-09 20:57 
AnswerRe: How many primary key constraints can we have in a table of ms-access? Pin
Colin Angus Mackay17-Jun-09 22:58
Colin Angus Mackay17-Jun-09 22:58 
AnswerRe: How many primary key constraints can we have in a table of ms-access? Pin
DoctorMick18-Jun-09 1:11
DoctorMick18-Jun-09 1:11 
QuestionHow Do I Print a file with Epson T88IV quickly? [modified] Pin
Member 239059517-Jun-09 18:53
Member 239059517-Jun-09 18:53 
AnswerRe: How Do I Print a file with Epson T88IV quickly? Pin
Aman Bhullar18-Jun-09 2:42
Aman Bhullar18-Jun-09 2:42 
GeneralRe: How Do I Print a file with Epson T88IV quickly? Pin
Member 239059518-Jun-09 22:49
Member 239059518-Jun-09 22:49 
GeneralRe: How Do I Print a file with Epson T88IV quickly? Pin
Aman Bhullar19-Jun-09 6:18
Aman Bhullar19-Jun-09 6:18 
Question.Net Date Compare Pin
Tristan Rhodes17-Jun-09 3:28
Tristan Rhodes17-Jun-09 3:28 
AnswerRe: .Net Date Compare Pin
Luc Pattyn17-Jun-09 3:39
sitebuilderLuc Pattyn17-Jun-09 3:39 
GeneralRe: .Net Date Compare Pin
Baran M17-Jun-09 3:50
Baran M17-Jun-09 3:50 
GeneralRe: .Net Date Compare Pin
Tristan Rhodes17-Jun-09 10:40
Tristan Rhodes17-Jun-09 10:40 
GeneralRe: .Net Date Compare Pin
Luc Pattyn17-Jun-09 10:48
sitebuilderLuc Pattyn17-Jun-09 10:48 
Hi,

it all depends on what you want exactly.

1.
if parts of the DateTime should be identical, then check those parts, as in:
DateTime dt1=...;
DateTime dt2=...;
if (dt1.Date==dt2.Date && dt1.Hours==dt2.Hours) isSufficientlyEqual();


the problem now is that 16:59:59 would equal to 16:00:00 and not to 17:00:00 which is much closer!

2.
if time distance is important, calculate it
DateTime dt1=...;
DateTime dt2=...;
if (dt1.Date==dt2.Date) {
    float seconds=dt1.Subtract(dt2).TotalSeconds;
    if (seconds>-100 && seconds<100) isSufficientlyClose();
}


3.
Up to the second equal:
DateTime dt1=...;
DateTime dt2=...;
if (dt1.AddMilliseconds(-dt1.MilliSeconds)==dt2.AddMilliseconds(-dt2.MilliSeconds)) {
    isPrettyClose();
}




Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

GeneralRe: .Net Date Compare - Code Clean Up, Use an Extension Method for DateTime Pin
ProtoBytes17-Jun-09 12:23
ProtoBytes17-Jun-09 12:23 
GeneralRe: .Net Date Compare - Code Clean Up, Use an Extension Method for DateTime Pin
Tristan Rhodes17-Jun-09 22:51
Tristan Rhodes17-Jun-09 22:51 
GeneralRe: .Net Date Compare Pin
Tristan Rhodes17-Jun-09 22:53
Tristan Rhodes17-Jun-09 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.