C# - ExecuteNonQuery() isn't working with SQL Server CE

前端 未结 2 1419
名媛妹妹
名媛妹妹 2021-01-16 01:59

I got some data inputed by the user that should be added to a Database File (.sdf). I\'ve choose Sql Server CE because this application is quite small, and i didn\'t saw nee

相关标签:
2条回答
  • 2021-01-16 02:02

    Are you sure you are looking at the right file? When you build your app in VS, it copies the SDF file as content to the target folder, so the database in your project will not reflect any updates. Your code is picking up the the file location there.

    This is btw not a good practice, because once deployed, the program folders are not writable to your app (could this be the problem - did you already deploy?). Instead, the database file should reside in your appdata folder.

    0 讨论(0)
  • 2021-01-16 02:02

    Is it possible that you make the call to AdicionarAuditorio in a TransactionScope without calling transactionScope.Complete()?

    0 讨论(0)
提交回复
热议问题