SmashAndGrab
asked on
Convert winform from Access DB to SQLCE - Errors.
Hi,
Like I said above I have converted my Winform C# application to use a SQLCE database. I am having a few errors mainly around the SQL statements.
Such as this..
The Sql statement is:
"Insert Into MCRS_MOBILE_DATA_LN (Ref, Product_Group, Sap_Code, RC_01, RC_02, RC_03, RC_04, RC_05, RC_06, RC_07, RC_08, RC_09, RC_10, RC_11, RC_12, RC_13, RC_99, Tot_Quant, AD_User, Date_Added, EAN, Prod_Description,Stock_Not _On_Sale) VALUES('14', '11', '264810', '1', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '5', 'MGR\\FFTILSBL', '13/06/2016 10:48:41', '5397007183504', '12mm 606x1220 BB/CC Chinese Hwd Ply', 'False')"
Please advise.
Like I said above I have converted my Winform C# application to use a SQLCE database. I am having a few errors mainly around the SQL statements.
Such as this..
The Sql statement is:
"Insert Into MCRS_MOBILE_DATA_LN (Ref, Product_Group, Sap_Code, RC_01, RC_02, RC_03, RC_04, RC_05, RC_06, RC_07, RC_08, RC_09, RC_10, RC_11, RC_12, RC_13, RC_99, Tot_Quant, AD_User, Date_Added, EAN, Prod_Description,Stock_Not
Please advise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try like DateTime.Now.ToString("yyy y/MMM/dd HH:mm:ss")
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
SmashAndGrab, if your issue has been solved please choose one or more comments as solution so this question can be closed properly.
ASKER
How do I do it programictally?
Currently I use this...
DateTime.Now
sql1 = @"Insert Into MCRS_MOBILE_DATA_LN (Ref, Product_Group, Sap_Code, RC_01, RC_02, RC_03, RC_04, RC_05, RC_06, RC_07, RC_08, RC_09, RC_10, RC_11, RC_12, RC_13, RC_99, Tot_Quant, AD_User, Date_Added, EAN, Prod_Description,Stock_Not
"VALUES('" + varREF + "', '" + tbProduct_Group.Text + "', '" + lblDSPSAP.Text + "', " +
"'" + tb01.Text + "', '" + tb02.Text + "', '" + tb03.Text + "', " +
"'" + tb04.Text + "', '" + tb05.Text + "', '" + tb06.Text + "', " +
"'" + tb07.Text + "', '" + tb08.Text + "', '" + tb09.Text + "', " +
"'" + tb10.Text + "', '" + tb11.Text + "', '" + tb12.Text + "', " +
"'" + tb13.Text + "', '0', '" + tbTotQuant.Text + "', " +
"'" + ADUserName + "', '" + DateTime.Now + "', '" + lblDspEAN.Text + "', " +
"'" + lblDSPDescrip.Text + "', '" + Convert.ToBoolean(cbStockN