Database file .sdf does not update after closing application

后端 未结 3 523
别跟我提以往
别跟我提以往 2020-12-12 05:55

I am creating a Desktop application using Microsoft Visual Studio .NET 2008. I am using a .sdf file as my database. My problem is that when I am making changes to my records

3条回答
  •  执念已碎
    2020-12-12 06:40

    Check you Application Folders and Make sure you are calling your database file from your bin file where it is located.

    something like:

    string startPath = Application.StartupPath;
    
    
    var filepath = startPath + "\\" + "Database.sdf";
    
    private SqlCeConnection conn = new SqlCeConnection("Data Source={0};Persist Security Info=False;",filepath);   
    

    Regards

提交回复
热议问题