0
votes

It seems I can design a class with DateTime Datatype as follows to be use in creating a table in SQlite DB:


 public class Customer
 {

   [PrimaryKey, AutoIncrement]
   public int CustomerId { get; set; }        

   public int CompanyID { get; set; }           

   public DateTime Time { get; set; }

   public decimal Price { get; set; }

 }

I have the following Questions:

  1. can use above Class for creating a table in SQLite

  2. can insert DateTime Data into the Table?

If Not, What is the workaround? What is the best practice to handle DateTime?

Would appreciate if you can provide some code that can query the table by DateTime using LinQ or Where/Select statement.

Thanks

1

1 Answers

0
votes

DateTime is acceptable in SQLite like normal data type (int, string, decimal, etc.). If you are facing any particualar problem while using DateTime, post the newer question.