Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Srikrishna.m
Starting Member
2 Posts |
Posted - 2009-09-05 : 05:27:48
|
| Hi Team,I have small issue which I am struggling with that.My issue is I am saving a record in which I have a datetime variable.And I am not assigning any datetime value to this variable while saving.So,it should store NULL in database by default.But,After saving,the field in the table is showing 01-01-1900 00:00:00 as the datetime but not NULL. Why this is happening...?Any tips are appreciated...Thanks,M.Srikrishna Murthy |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-05 : 06:08:31
|
| How are you sending dates to the table?MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-09-05 : 06:13:31
|
| it seems like your default value passed for datetime variable is 0 which is equivalent to date 01-01-1900 00:00:00 |
 |
|
|
Srikrishna.m
Starting Member
2 Posts |
Posted - 2009-09-05 : 06:16:18
|
| Hi , In my application data goes from the system interfaces to the DA layers.In Da layers,In insert method ,I have written the following piece of code. parameterArray[7] = CreateParameter("StartDate", DbType.DateTime); parameterArray[7].Value =GetParamValue(obj.StartDate); cmdWorkOrder = CreateDbCommand(sqlQry.ToString()); //Adding parameters cmdWorkOrder.Parameters.AddRange(parameterArray); //Execute the Query rowsEffected = ExecuteNonQuery(cmdWorkOrder);M.Srikrishna Murthy |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-05 : 06:19:08
|
| Make sure obj.StartDate has the correct dateMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-09-05 : 06:19:14
|
| what does GetParamValue(obj.StartDate); return as value? |
 |
|
|
|
|
|