SqlCeConnection sqlCnn =
new SqlCeConnection(Properties.Settings.Default.mainDBConnectionString);
SqlCeCommand sqlCmd = new SqlCeCommand(
"INSERT INTO desktopItems (Location,Label) VALUES (@Location, @Label)",
sqlCnn);
sqlCnn.Open();
sqlCmd.Parameters.Add("@Location", openExe.FileName.ToString());
sqlCmd.Parameters.Add("@Label", openExe.SafeFileName.ToString());
sqlCmd.ExecuteNonQuery();
sqlCnn.Close();
我有这段代码,但是当我运行程序时,数据库没有更新......