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

Discussion in 'C#' started by dreskei, Oct 29, 2010.

  1. dreskei

    dreskei New Member

    Joined:
    Oct 22, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    delhi
    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
     
  2. dotNet Zombie

    dotNet Zombie New Member

    Joined:
    Aug 28, 2010
    Messages:
    34
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    .Net Developers
    Location:
    Minnesota
    Home Page:
    http://www.dotnetzombie.net
    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];
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice