4
Answers

System error(missing operator) in query expression '19-06-2012'

Photo of rimmi anand

rimmi anand

12y
1.7k
1
public void purchaseProduct(string productname, string challan_no, DateTime challan_date, string bill_no, DateTime bill_date, string Customer,string InvoiceNo)
        {
                    con.Open();
                    OleDbCommand insert = new OleDbCommand("INSERT INTO [PRODUCT_DETAILS]([PRODUCT_NAME],[CHALLAN_NO],[CHALLAN_DATE],[BILL_NO],[BILL_DATE],[CUST_NAME],[INVOICE_NO])VALUES('"+productname+"','"+challan_no+"',"+challan_date+",'"+bill_no+"',"+ bill_date +",'"+Customer+"','"+InvoiceNo+"')", con);
                    insert.ExecuteNonQuery();
                    MessageBox.Show("Your data has been saved.");

            }
How to save date in access database from datetime picker in c#. I have passed values in the following manner:
add.purchaseProduct(txtproductname.Text.ToUpper(), txtchallan_no.Text.ToUpper(), txtchallan_date.Value, txtbill_no.Text.ToUpper(), txtbill_date.Value, txtCustomer.Text.ToUpper(), invoiceNo);

I have tried hash in front of date but i ddidnt succed. How to save date in access date/Time datatype format in access. 

Answers (4)

0
Photo of Bechir Bejaoui
NA 20.1k 5.3m 16y
May it be, anyway, my OS is XP
0
Photo of Sergey Sharikov
NA 3 0 16y

Hi,

It seems that signinficant performance slowdown can be seen only on Vista with Aero turned on. Note, that my machine should support Aero (quad 2.53, 4 Gb Ram, GeGorce 9800 GT), so the problem must be somewhere inside Aero..

Thanks,

Sergey.

 

0
Photo of Bechir Bejaoui
NA 20.1k 5.3m 16y

It's strange, I copied your code and try it and is perfect, there aren't any applications slow down!!
Is there any other code that interfers with this one? might it negatively affects it.