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

Go4Expert Member
30Oct2010,00:59   #1
dreskei's Avatar
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
Go4Expert Member
1Nov2010,20:47   #2
dotNet Zombie's Avatar
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];