in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Problems in insert and retriving dates

Last post 09-25-2009 3:37 AM by jcaldwell. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-11-2009 2:21 AM

    • Prachi
    • Top 150 Contributor
    • Joined on 09-10-2009
    • Posts 9

    Problems in insert and retriving dates

    I am new user of sqlite I have the following table CREATE TABLE Sighting ( SightingId integer PRIMARY KEY AUTOINCREMENT NOT NULL, SpeciesId integer, LocationId integer, SightingDate date, Note nvarchar(100) ); and the following insert INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note) VALUES (3005,22,'2/26/2008','New Note') the insert works EXCEPT the date keeps coming in as NULL! What am I doing wrong? Please give me a sample example to insert and retrive the table with dates using vb.net Also tell me how to get date values from datareader. I have written the fillowing code Dim dblrepr As Double = CType(dr.GetDouble(23), Double) Dim dlocal As DateTime = DateTime.FromOADate(dblrepr).ToLocalTime but giving error :- specific cast is not valid.
  • 09-25-2009 3:37 AM In reply to

    Re: Problems in insert and retriving dates

    Try formating the date in the yyyy-dd-MM format.  The format you are using can be ambiguous as you can not be sure if it is MM/dd/yyyy or dd/MM/yyyy.

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems