Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Keep from erasing working code in a project

Keep from erasing working code in a project

Scheduled Pinned Locked Moved C#
csharpquestionlearning
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tonyonlinux
    wrote on last edited by
    #1

    Okay, I'm sure someone out there besides me has wondered this so here goes. Lets say your like me and learning c# or your a professional either way. If your working on a project and lets say you get it all working then someone wants something different added or deleted. How do you go about editing the working code without risking screwing up the whole project? What I mean is this. Lets say program1 had a button and you build the project and all works fine. Then later on you decide you don't want the button so you open up the project and remove it. If all crap breaks loose and it no longer runs how would you revert back to the old so you can try something different? I have been taking and raring the project folder as a backup and then just working from there but is there a better way to do this ?

    L A 2 Replies Last reply
    0
    • T tonyonlinux

      Okay, I'm sure someone out there besides me has wondered this so here goes. Lets say your like me and learning c# or your a professional either way. If your working on a project and lets say you get it all working then someone wants something different added or deleted. How do you go about editing the working code without risking screwing up the whole project? What I mean is this. Lets say program1 had a button and you build the project and all works fine. Then later on you decide you don't want the button so you open up the project and remove it. If all crap breaks loose and it no longer runs how would you revert back to the old so you can try something different? I have been taking and raring the project folder as a backup and then just working from there but is there a better way to do this ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      use source control, like source safe from microsoft. if everything ok, then checkin the code. then you can change the code and test it again. if something going wrong, then you can get the source code before changes from source control.

      T 1 Reply Last reply
      0
      • L Lost User

        use source control, like source safe from microsoft. if everything ok, then checkin the code. then you can change the code and test it again. if something going wrong, then you can get the source code before changes from source control.

        T Offline
        T Offline
        tonyonlinux
        wrote on last edited by
        #3

        thanks. One last question before I call it quits for the night. On the toolstrip one can have add delete save whatever. Well if I remove the delete button how in the heck can i get it back or do I have to delete the toolstrip and start over? Or is there an easy way to add an event that does the same thing as the delete? Like databindingsource.delete(current) or whatever? Sorry for all the questions I'm just trying to understand this stuff.

        B 1 Reply Last reply
        0
        • T tonyonlinux

          Okay, I'm sure someone out there besides me has wondered this so here goes. Lets say your like me and learning c# or your a professional either way. If your working on a project and lets say you get it all working then someone wants something different added or deleted. How do you go about editing the working code without risking screwing up the whole project? What I mean is this. Lets say program1 had a button and you build the project and all works fine. Then later on you decide you don't want the button so you open up the project and remove it. If all crap breaks loose and it no longer runs how would you revert back to the old so you can try something different? I have been taking and raring the project folder as a backup and then just working from there but is there a better way to do this ?

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          Source control is what you need. There are a number of free ones and even more that cost you. Just google for source control and you will find loads. This is how the vast majority of commercial development is controlled.

          Bob Ashfield Consultants Ltd

          1 Reply Last reply
          0
          • T tonyonlinux

            thanks. One last question before I call it quits for the night. On the toolstrip one can have add delete save whatever. Well if I remove the delete button how in the heck can i get it back or do I have to delete the toolstrip and start over? Or is there an easy way to add an event that does the same thing as the delete? Like databindingsource.delete(current) or whatever? Sorry for all the questions I'm just trying to understand this stuff.

            B Offline
            B Offline
            Bekjong
            wrote on last edited by
            #5

            If you use a source control solution you'll be able to "commit" your working code. If you then decide to remove the "delete" button and change your mind on that, you can simply put back the old code using you source control program and the button will be there again. I have no idea what it is that you want to delete, but if you need to duplicate the function of your delete button you can just copy the code in the event handler for it's click event to the place you need it to be. If this concept is unclear you might want to pick up a book on c# as this is very very basic stuff.

            Standards are great! Everybody should have one!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups