Omar,
Use parameters (the rest should go automatic)
http://msdn.microsoft.com/library/de...eterstopic.asp
Be aware that you have in OleDb to add the parameters in the sequents of
occurence of your SQL string
I hope this helps,
Cor
"Omer kamal" <(E-Mail Removed)> schreef in bericht
news:dg2u7n$5c3$(E-Mail Removed)...
> Dear all,
>
> I want to save my data into MS Access database Table which consist of some
> fields with short date and short time formats.
> I try to save data in to the said table and I am getting error that my SQL
> statment is not correct.
>
> string strSQL = @"INSERT INTO Activities ( Task,Day,Start,Finish ) VALUES
> ( '"+id+"', '"+date+"', '"+start+"', '"+finish+"' )" ;
>
> I think error is because i am not able to cast my variables correctly.
>
> how can i convert my DateTime to short date and short Time formats???
>
> regards,
>
> Omer kamal