I must be missing something...

This is my code:

   OpenFileDialog o = new OpenFileDialog();
   o.Filter = "SQL Server Compact Edition Database File|.sdf";
   o.ShowDialog();

In the actual folder there is definitely a .sdf file:

enter image description here

And then in the file picker (the same folder) it doesn't show it:

enter image description here

Is it because it only works for certain types of files or something?

有帮助吗?

解决方案

I suspect you're just missing the * wildcard in the matching part:

o.Filter = "SQL Server Compact Edition Database File|*.sdf";
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top