Click here to Skip to main content
15,889,528 members
Home / Discussions / C#
   

C#

 
GeneralRe: Expense Tracker tool Pin
Heath Stewart2-Sep-04 11:11
protectorHeath Stewart2-Sep-04 11:11 
GeneralC# System Window bar gradient colors Pin
Tristan Rhodes2-Sep-04 9:39
Tristan Rhodes2-Sep-04 9:39 
GeneralRe: C# System Window bar gradient colors Pin
Heath Stewart2-Sep-04 14:43
protectorHeath Stewart2-Sep-04 14:43 
GeneralRe: C# System Window bar gradient colors Pin
Tristan Rhodes2-Sep-04 17:01
Tristan Rhodes2-Sep-04 17:01 
GeneralRe: C# System Window bar gradient colors Pin
Heath Stewart3-Sep-04 6:13
protectorHeath Stewart3-Sep-04 6:13 
GeneralRe: C# System Window bar gradient colors Pin
Roland Bär2-Sep-04 20:16
Roland Bär2-Sep-04 20:16 
GeneralVS.NET 2005 Refresh Pin
Werdna2-Sep-04 9:25
Werdna2-Sep-04 9:25 
General.Net DateTime type and SQL DateTime type Pin
matthias s.2-Sep-04 7:32
matthias s.2-Sep-04 7:32 
Hi there,

I'm writing a C# application and using a C#Express Beta2 and SQLExpress Beta2:

I've created an object (say 'Human') which I persist to a SQL DB table. Human has a DateOfBirth property of the (.Net) type DateTime. The apropriate field in the table is of SQL type DateTime. Now I create an instance of my Human and set the DateOfBirth to yesterday using the following code:
Human Human1 = new Human();
Human1.DateOfBirth = new DateTime.Now.Substract(new TimeSpan(1, 0, 0, 0));

Then that I persist my you Human to the database. After that I create a new instance of my Human (Human2) and read it's property-values from the database, like:
if(Human1.DateOfBirth == Human2.DateOfBirth) {
// this code is never reached :)
}

Comparing Human1's DateOfBirth with Human2's I do not get the expected result as the two DateTime objects return the same Date and Time, but looking at the DateTime.Tick property I see some fractional differences Smile | :) .

How do you handle this? Thanks in advance.

Matthias



If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)

www.emvoid.de

GeneralRe: .Net DateTime type and SQL DateTime type Pin
partyganger2-Sep-04 8:37
partyganger2-Sep-04 8:37 
GeneralRe: .Net DateTime type and SQL DateTime type Pin
Gary Thom2-Sep-04 8:54
Gary Thom2-Sep-04 8:54 
GeneralC# equivalent to CStringList Pin
Glenn E. Lanier II2-Sep-04 5:59
Glenn E. Lanier II2-Sep-04 5:59 
GeneralRe: C# equivalent to CStringList Pin
Werdna2-Sep-04 6:03
Werdna2-Sep-04 6:03 
GeneralRe: C# equivalent to CStringList Pin
Colin Angus Mackay2-Sep-04 6:04
Colin Angus Mackay2-Sep-04 6:04 
GeneralRe: C# equivalent to CStringList Pin
Glenn E. Lanier II2-Sep-04 6:27
Glenn E. Lanier II2-Sep-04 6:27 
GeneralRe: C# equivalent to CStringList Pin
Colin Angus Mackay2-Sep-04 6:04
Colin Angus Mackay2-Sep-04 6:04 
GeneralRe: C# equivalent to CStringList Pin
Glenn E. Lanier II2-Sep-04 6:28
Glenn E. Lanier II2-Sep-04 6:28 
GeneralRe: C# equivalent to CStringList Pin
Nick Parker2-Sep-04 9:31
protectorNick Parker2-Sep-04 9:31 
GeneralDos commands in C# Pin
exhaulted2-Sep-04 4:31
exhaulted2-Sep-04 4:31 
GeneralRe: Dos commands in C# Pin
mav.northwind2-Sep-04 5:36
mav.northwind2-Sep-04 5:36 
GeneralRe: Dos commands in C# Pin
exhaulted2-Sep-04 6:14
exhaulted2-Sep-04 6:14 
GeneralRe: Dos commands in C# Pin
mav.northwind2-Sep-04 6:28
mav.northwind2-Sep-04 6:28 
GeneralThe Infragistics Web Grid Big BIG problem Pin
Anonymous2-Sep-04 4:20
Anonymous2-Sep-04 4:20 
GeneralRe: The Infragistics Web Grid Big BIG problem Pin
Dave Kreskowiak2-Sep-04 5:50
mveDave Kreskowiak2-Sep-04 5:50 
GeneralDouble Buffering API Theme paint problem Pin
Tristan Rhodes2-Sep-04 1:52
Tristan Rhodes2-Sep-04 1:52 
GeneralRe: Double Buffering API Theme paint problem Pin
Werdna2-Sep-04 6:06
Werdna2-Sep-04 6:06 

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.