Updation Problem
Hi all
I am writing one update query in c#
cmd.CommandText = "Update dbo.drycleaner_customercoupon_status set coupon_date=" + DateTime.Today.ToShortDateString() + ",coupon_status='" + status + "' where customer_name='" + Session["cust_name"] + "' " + " and " + " coupon_code='" + Session["codetype"] + "'";
This query runs perfect but store in database as "1/1/1900 12:00:00 AM".it's wrong date becoz i store today's date.
what is actual problem i am not getting.
Pls hepl me
Thanks
|