Gabro
May 15th, 2002, 03:20 AM
my problem goes likes this:
whenever a user creates a record (application is coded in C#), the program should automatically insert the current date into the SQL Server DB together with the record. the field for the date in the DB is defined as datetime. However, I have problems coming up with the appropriate c# code to insert the time into the DB. I do not wish to change the data type to string and have the date converted to a string first b4 I store it in the DB. Help is greatly appreciated.
one other thing. SQL Server would automatically insert the time if I manually keyed in a date in the DB. Is there anyway I can bypass that? I'm not interested in the time at all? Anyway, I'm using SQL Server 7. Would SQL Server 2000 provide a bettter fix for my problem?
whenever a user creates a record (application is coded in C#), the program should automatically insert the current date into the SQL Server DB together with the record. the field for the date in the DB is defined as datetime. However, I have problems coming up with the appropriate c# code to insert the time into the DB. I do not wish to change the data type to string and have the date converted to a string first b4 I store it in the DB. Help is greatly appreciated.
one other thing. SQL Server would automatically insert the time if I manually keyed in a date in the DB. Is there anyway I can bypass that? I'm not interested in the time at all? Anyway, I'm using SQL Server 7. Would SQL Server 2000 provide a bettter fix for my problem?