Open GoogleCodeExporter opened 9 years ago
can you provide relevant codesnippets to reproduce?
Original comment by dip...@gmail.com
on 10 Oct 2008 at 11:52
I can post some:
Database.AddTable("News",
new Column("id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),
new Column("title", DbType.String, 50),
new Column("text", DbType.String, 50),
new Column("created_at", DbType.DateTime),
new Column("updated_at", DbType.DateTime)
);
So, here's a wrong way:
Database.Insert("News",
new string[] {"title", "text", "created_at", "updated_at"},
new string[] {"First Title", "First Text",
DateTime.Now.ToString(), DateTime.Now.ToString() } );
Here's a right way:
DateTime.Now.ToString("yyyy-MM-dd")
Basically, you should specify the date format you DB supports, whether its
yyyy-MM-
dd, or dd-MM-yyyy or slashes instead of dashes. Whatever you need.
But i think that's still a wrong way of doing it all. You should use object[]
instead
of string[] in Database.Insert().
If you want a patch, let me know via email oleksandr.petrov@gmail.com
I think i can handle this one, if it falls under your ideology, and than you
should
check the type of the required object. For Db DateTime you use
DateTime->object->cast
back to datetime.
Original comment by oleksand...@gmail.com
on 30 May 2010 at 3:41
Original issue reported on code.google.com by
ric...@gmail.com
on 9 Oct 2008 at 2:53