Click here to Skip to main content
11,639,593 members (62,000 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-CE C# DataGridView Forms , +
Hi everyone!

Is it possible to use the SaveFileDialog in Visual Studio 2012 to allow the user to save a .sdf file anywhere they want to? That's what I mean by "exporting" the .sdf file out of the project location (or installed directory) when the program is installed on an end-user's computer. Or is savefiledialog only limited to text-based files.

We are making an administrative side of the 1st part of the project that I began on and the reason for needing to export the .sdf file so the administrators can upload the .sdf file so the 1st part of the project can detect changes and download the .sdf file automatically and update the database.
Posted 13-Mar-13 7:48am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use SaveFileDialog for any type of file.

Some unsolicited advice
I would be cautious about allowing your end-user to save your database file anywhere they want. After a while, you may end up with copies in multiple places. An option would be to automatically save the copy to a location coded into your application. Better yet (much better!), add a LastChanged DateTimestamp to each table in your database and use that to determine which rows have been updated since the last check. Set LastChanged to NOW() whenever you do an INSERT or UPDATE.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

research to create software and hardware
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Suvendu Shekhar Giri 330
1 Sergey Alexandrovich Kryukov 244
2 CPallini 177
3 F-ES Sitecore 170
4 himanshu agarwal 167
0 OriginalGriff 9,081
1 Sergey Alexandrovich Kryukov 8,812
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,650
4 F-ES Sitecore 2,548


Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 10 Jul 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100