Вопрос

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