CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Location
    uae
    Posts
    11

    vb-sql server date field problem:URGENT

    in my vb application i am using DTPicker in forms.
    when i am trying to insert datefield as dd/mm/yy format in my table
    (sql server) through my vb application error is occured . the error is

    error -2147217913 conversion of a char data type to a datetime data
    type resulted in an out of datetime value

    when i try to insert datefield on dd/mm/yyyy through query analyser there is
    no problem

    help me and send some soucecode to solve this problem in my vb application
    its very urgent







  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: vb-sql server date field problem:URGENT

    You must almways send your dates to SQL Server in the format that SQL Server knows, that is, the format defined in the local settings of your server machine. If it still fails, try passing the date in a form that it can't possibly make a mistake, like 'december 25 2001' or something.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured