You should start by replacing
SqlCeConnection con = new SqlCeConnection("Data Source="H:\application\database.sdf"");
with
SqlCeConnection con = new SqlCeConnection("Data Source=""H:\\application\\database.sdf""");
and see if it changes something.
Quotes in a string have to be doubled or escaped ; and it is the same with backslashes.
You can find the reference here:
String literals[
^]
[edit]
You do not seem to ever open your connection ; that can be the problem, also.
A better way to handle that would certainly be:
using (SqlCeConnection con = new SqlCeConnection("Data Source=""H:\\application\\database.sdf""")) {
try {
con.Open();
}
catch (SqlCeException e) {
MessageBox.Show(e.Message);
}
}
[/edit]