المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : SQLite datatime



C# Programming
11-12-2009, 07:20 PM
Hi all, I am trying to insert data into sqlite datetime, but it seems like making my life really deficult.

this is what I have done to do this;
con.Open();
cmd = new SQLiteCommand();
cmd = con.CreateCommand();
cmd.Connection = con;
cmd.CommandText = " INSERT INTO Hall_Call_Up (Call,Time) VALUES ('1','" + dateTime.Now.ToString("YYYY-MM-DD HH:MM:SS") + "')";
cmd.ExecuteNonQuery();
this is giving me error saying "Unable to read data"

But if I connect to datagridview and I do this;
this.hall_Call_UpTableAdapter.Insert(1, DateTime.Now);
it is working.
Can some one please help me.

thanks