Moving a .sdf file into isolated storage - windows-phone-7

How do I move a .sdf file into my isolated storage and after I have moved it is there a way to delete it as it is of no use. I have added my .sdf file as a content in my project.

Your question is not very clear, but let me see if I get this. You created a database, added it to your file as content to your project so that you can have all the data present when the user installs your app. Then you are copying the data from the read-only .sdf file into a database that you are creating on first run, so that you can read/write to it. Correct?
If so, I do not believe there is a way to delete the read-only file that you included with the install.
If your database is large enough that you are concerned about the space it will take by having two copies of it on the phone, I would suggest placing your data on a server, creating a web service, and access that web service on first run. Place a notice on the screen that lets your user know that it is downloading information that will only be downloaded once, and that subsequent launches will not take as long. Be sure you include code to prevent a problem should the download be interrupted by a phone call, text message, back key press, start button, or other event. Make it be able to continue the download if it was interrupted in a prior run.

To answer your question, .SDF is a format of Microsoft SQL Server Compact (SQL CE) databases. The link you have pasted talks about SQLite databases.
This the way to download the entire Isolated Storage onto your device.
Open cmd and go to the following directory
C:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool
then use the isetool.exe to download the Isolated Storage along with the .sdf file onto your machine.
isetool.exe ts xd [Product_id_here_see_WMAppManifest.xml] "D:\Sandbox"
You should get message like download successful into D:\Sandbox.
You can also upload the sdf by changing the argument ts with rs

Related

How to tell if OneDrive file synce has completed

I have a MS Access database which copies the database to a OneDrive folder upon shutting down. I don't want Access to completely exit until the copy has completed copying the file to the OneDrive cloud. I haven't been able to figure out how to check for this. Using VBA I've tried looking to see if the file exists (it does) and if the filesizes are the same (they are), but I can see that it's still synching.
When I look at the file properties/details, I can see that it's marked as "Available offline". I don't see any way to set this to be Available Online Only. I'm running Windows 10.
-- Geoff
The only solution that I've found was to map the OneDrive to a network drive as described here: https://www.youtube.com/watch?v=qm1Of4eFDDY and then do the copy to the mapped drive. The copy completes when then entire file is on the cloud.
-- Geoff

View recent files in Management Studio

I trying to find a SQL script that a former colleague of mine used to run periodically. His instructions are to log onto his machine and go to his recent files and select the file.
He doesnt remember where the file physically exists as every time he runs it he would open the file via this method.
My question is how do I access this list? Problem is we wiped his machine and made a copy of his HD. ive tried navigating to \USERS\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\ but there is nothing obvious I can use here.
Appreciate your comments.
I believe this is tracked in the in the following location (depending on your version of SQL) in the registry
HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0\FileMRUList
[Edit] On a side note, rather than looking for this recent list I would use a grep tool like textcrawler (free, and awesome) to search for a particular string (presumably you remember some sprocs that are called or tables that are accessed by the script) within all .sql files on the hard disk.
In SSMS version 18, the registry path to the recent file list is:
HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\18.0_IsoShell\MRUItems{01235aad-8f1b-429f-9d02-61a0101ea275}\Items
Keep in mind, you must restart SSMS for any changes to take effect.

Automatically Check In File On Save In Visual Source Safe

Is it possible to automatically check a file into Visual Source Safe after the local (working) copy had been changed? Our current process involves editing our code on Windows computer that are running VSS Explorer and after a check in VSS shadow copies the files to the devel Linux server. We're spending a lot of time manually checking the file back in through VSS and would like to just have it push every time we save the files.
Thanks,
Why not write a small app that monitors the folder for updated files, and when they are updated, open your VSS connection and checkin to VSS via a specified or hardcoded path? Just an idea though. I believe you can use something such as FileSystemWatcher. http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx

Visual Studio and an Access Database - Operation must use an updateable query

I am deploying an .accdb file to the same directory as my windows forms program is being installed. However when attempting to update data in the database i get a "Operation must use an updateable query" error.
The file attributes are not read only, however when I open the accdb file it stats that the database has been opened read only. I must save a copy to make it not read only.
I do not believe this has anything to do with permissions, or file attributes. This is only on Vista, XP appears to work ok. The original accdb file is not read only when i open it.
What is visual studio doing to the accdb file to make it read only? and how can i fix it.
Are you installing into the Program Files heierarchy? If so that's read only for users and would cause the Access database to be read only. You should be installed any Access database file to the users Application Data folder.

Problem with an MSI distribution

So I am continuing testing and releasing changes to my app and I have come across a pain point that I am unsure how to deal with.
First off, my app uses a SQL Server CE database to store information and I need to be able to make changes to this db so I've created an internally updating process that runs whenever the application runs to make sure the db is up to date.
The crux of this internal update process is another SDF file named DBUpdates.sdf that contains all of the db schema changes that need to be applied.
The problem I am having is that the MSI distribution I created will not overwrite this file. It appears that when SQL Server CE opens this file, it changes the Modified date/time of the file. This is a flag to the MSI process that the file has changed, and that it shouldn't overwrite the file. Well now I am seeing that my db changes aren't being applied, because the MSI process thinks the user has changed this file.
At this point I am kind of stumped. I was planning on using an MSI distribution but maybe I can't. What do you think?
What about storing your .sdf as an embedded resource in your executable, and then extracting it to a temporary location on disk (as necessary) and perform the updates.
Unversioned files with MSI can be a bit difficult to handle if you need to force the installation of the file. You can see this previous question, for some ideas, How to add a version number to an Access file in a .msi.
The question contains a link to this blog post, http://blogs.msdn.com/astebner/archive/2005/08/30/458295.aspx, which suggests the way I prefer to deal with this problem. Add the .sdf file to be part of your executable's component. The downside to this is if someone delete the .sdf file, but not your executable I don't think a repair of the application will catch this. If your using Visual Studio to create your MSI files then this may prove a difficult solution to implement. I strongly suggest your check out WIX in that case. It is a better MSI build system.

Resources