Question Restore Stable Project

Styles

Member
Joined
Sep 23, 2010
Messages
16
Programming Experience
Beginner
All,

I couldn't find this anywhere and perhaps I am using the wrong terminology. Is there any way to restore a project to a previous "stable" state? I have already published the project if that helps. I kid you not I had VS 2008 open and was making some updates to a project when I left for all of 5 minutes. During that time my adorable son 3 years old decided he wanted to text my wife from the computer. He managed to delete my data source and exit VS2008. Ok yea laugh away I thought it was funny at first too till I noticed the damage. As I said I have a published version saved already can I restore it from there? Any help would be greatly appreciated.

Thank you in advance.

Scott
 
In general you would need something like a source safe system or a backup, which you don't obviously.
Getting source code back from published version is difficult and troublesome, what happens is that when you compile the source code is translated to MSIL assembly code, which is quite different from the higher level VB language. I'm sure you haven't obfuscated the code (else you wouldn't have asked), so it may to some extent (*) be translated back with a disassembler, one such tool is this: .NET Reflector, class browser, analyzer and decompiler for .NET
(*) It will be a complete source, but not identical to your original source. Some code is rearranged, and you may see code that is usually hidden from VB language.
 
JohnH,

Thank you for the quick response. And no I have not "obfuscated" my project. Is this something I should do to prevent this from happening again? If so any good sites for literature? If I am forced to redo the project I can since the code is still there just the datasource got deleted. All the tables and different datagrids I had do not work anymore since I added the datasource back. I was just hoping that there was an easier fix than this. I had told my boss that the project was done as it was, just found a few bugs I was fixing.
 
since the code is still there just the datasource got deleted
Ok, I somehow was thinking the source code was gone. Not sure what you mean by 'datasource got deleted' though. If you mean connection you may be able to resolve running the data source wizard again and map to the new connection.
 
Sorry for any confusion but I am still very new to VB.NET. I took on this project for the experience. My project is still available when I open Visual Studio 2008. I really don't know what my son (2 1/2) really did. The data source connection was missing from the Solution Explorer when I restarted it. I have several forms that have multiple data grids that are dependent on user selection. I already tried to add the new data source but that has not solved the problem only made things worse. I now have several errors in the form.vb coding. Would it be in my best interest to just copy all the code into a new project, reset my forms and add the data source? This wouldn't take long but I would have to figure out all my settings again for the data sources and their conditions. In the future would you have any recommendations on saving project in another area or steps to stop this from happening in the future? Again thank you for your help.
 
If I couldn't quickly resolve it and it wasn't complex I would just start new project, set up the data stuff, and copy the user code and configure form.

'Source safe' software has version control functionality, if that is not needed you just need to rely on regular backups. A backup could be as simple as you say to just copy the source folder to a different area on the machine or external device. Personally my versioning needs is so simple that I just keep multiple project folders, for work I do daily backups to an external device and at home I 'try' to do backups at least once a month. In the case of computer failure or other accidents it really pays off in the long run to take the time to backup data you'd hate to see lost. Computer software and hardware problems do occur occationally and so does human errors.
 
Back
Top