in c#.net we are taking datetime from datetimepicker we are storing datetime into sqlserverdatabase.
in sqlserver we are taking datetime datatype.
we write code like this:
cmd=new sqlcommand("insert into values(date) tablename('"+dt+"')",con);
we are seleted date datetimepicker as 19/12/2006
after excuting this one we are getting error like this:
conversion of char data type to datetime data type resulted in an out of range datetime value
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!