为什么将更改保存到数据库失败?
下面是控制台应用程序中的C#代码。
每当我调试应用程序并运行query1(它向数据库中插入一个新值),然后运行query2(它显示数据库中的所有条目),我就可以清楚地看到我插入的新条目。但是,当我关闭应用程序并检查数据库中的表(在VisualStudio中)时,它就消失了。我不知道它为什么不储蓄。using System;using System.Collections.Generic;using System.Data.Entity;using System.Linq;using System.Text;using System.Threading.Tasks;
using System.Data.SqlServerCe;using System.Data;namespace ConsoleApplication1{
class Program
{
static void Main(string[] args)
{
try
{
string fileName = "FlowerShop.sdf";
string fileLocation = "|DataDirectory|\\";
DatabaseAccess dbAccess = new DatabaseAccess();
dbAccess.Connect(fileName, fileLocation);
Console.WriteLine("Connected to the following database:\n"+fileLocation + fileName+"\n");
string quer