save date and time separately in sql 2005 using c#.net

dreskei's Avatar, Join Date: Oct 2010
Go4Expert Member
i have to insert date and time separately into the record using c#.net.....i tried a lot...but it gives an error "object reference not set to an instance of an object"

please help me out
dotNet Zombie's Avatar, Join Date: Aug 2010
Go4Expert Member
What does your Data Schema look like.

Explain a little more what you mean by seperating the date and time. Are you doing something like this?

Code:
  
string[] arrayDate = DateTime.Now.Date.ToString().Split(' ');
string date = arrayDate[0];
string time = arrayDate[1];