I've create object with data type: DateTime But I want save as char data type in sql server
ex: assign value to obj property: MyDateTime=DateTime.Now; //when use to string method result: MM/dd/yyyy hh:mm:ss //save to db MyDateTime column with data type char(12) we will save: MM/dd/yyyy
How can I save it. I try use assign converter attribute to property but does not effect
Update: 2010/09/24 13:36
Ex:
DataContext data=new DataContext();
MyObject obj=new MyObject();
obj.MyDate=DateTime.Now;
data.MyObjects.InsertOnSubmit(obj);
data.SubmitChange();
property's data type of object is: DateTime
column in db is char(12)
how can I format it or write custom attribute to format data before save to db