Basically what I am trying to do is run a small WPF program, where the user will select a SQL Server Compact database and my program will show them specific information from a specific table.
Where I am having trouble is the connection string, I want the user to be able to browse to the location where their database is saved, and not make them have it in the one location (if that makes sense)
I can get my program to work if I have the database in one location with a specific name, but the databases the user will want to check the information for will all have different names but all will have the same file extension
e.g. the code I have at the moment is this:
string Myfile = @"C:\Users\documents\visual studio 2010\debug\FILE.sdf";
SqlCeConnection localDatabaseConn = new SqlCeConnection("data base = " + Myfile +";
I can get the result I want when I have the file saved to a specific location with a specific name, but I want the user to be able to browse to their own file, which will have a different name and could be anywhere on their machine.
Any help would be appreciated
So, basically it seems you want an OpenFileDialog.
Example: