エラーが発生しています。ここで何が問題なのですか?
SqlCeCommand com5 = new SqlCeCommand("SELECT MAX(OrderID) AS Expr1 FROM Order_Details)", con);
SqlCeDataReader dr5 = com5.ExecuteReader(); // Catches Ex here
while (dr5.Read())
{
orderID = Convert.ToInt32(dr[0]);
}
、、 で使用SQLCe
しています。VS2012
WPF
C#
例外は
$exception {"クエリの解析中にエラーが発生しました。[ トークン行番号 = 1、トークン行オフセット = 62、トークンのエラー = ) ]"} System.Exception {System.Data.SqlServerCe.SqlCeException}`
クエリは正しいのですが、これらのクエリではデータベースが更新されません。調べてもらえますか。
SqlCeCommand com3 = new SqlCeCommand("INSERT INTO Order_Details(Discount, TotalPrice, TotalTax) VALUES(@Discount, @TotalPrice, @TotalTax)", con);
com3.Parameters.AddWithValue("@Discount", discount);
com3.Parameters.AddWithValue("@TotalPrice", gTotal);
com3.Parameters.AddWithValue("@TotalTax", totalIndividualTax);