Thursday 15 August 2013

c# - How to handle exception if Entity DB file is not found -


I am using Antiti FY with SQL Server Compact database. The problem is, I do not understand how and how to handle the system. Data.EntityException If you do not have a database file, because when I start my application I "Kkagr stopped working" window pops up with the following details

  Problem signature: problem name: CLR20r3 problem signature 01: AVIOB1BUUW4KTDA4Y2PQRQUMWZFODHST problem signature 02: 1.0.0.0 problem signature 03: 5151de5d problem signature 04: System.Data.SqlServerCe problem signature 05: 4.0.8876.1 problem signature 06: 4fcd17f1 problem signature 07: 17b S Msya Signature 08: 4ad Problem signature 09: System.Data.EntityException   

Also, I'm not running it may not seem debug applications VS2012, because of error, so I find it dB File had to be manually renamed by renaming the name

how and Where to handle this exception?

something like:

  if (! File.Exists (NameAndLocationofDBFi Le)} {System.Windows.Forms.MessageBox.Show ("database file does not exist"); Return; // present application}    

No comments:

Post a Comment