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
C

Charles T Blankenship

@Charles T Blankenship
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Backup / Restore SQL Databases without the need of SMO
    C Charles T Blankenship

    Introduction I initially pulled this from the internet over a decade ago and had to open it back up when my client didn't want to use SMSS. I gave him the option to backup and restore his SQL Server with a few mouse clicks. Background My client was too cheap to purchase a real backup/restore SQL Server application so I created/enhanced this to enable him to do it with just a few mouse clicks.; If you would like to enhance the code and collaborate on potential enhancements you can download the code from git hub here https://www.github.com/CTBlankenship/BackupRestore\_Source Using the code There are a few things you need to do to get this to work for you. The first is directory definitions: 1. A scratch pad area where the .bak file is copied prior to being compressed and copied to the destination directory. There should never be a .bak file in this directory since it is deleted after it is used to create a .zip file 2. The location of your SQL Server database and log files (.ldf and .mdf) 3. The location directory where you want to store the compressed .bak files (which are now zip files) Secondly, edit the main form code behind to specify a connection string for the application. I've keyed the connections to recognize machine names. So, when I copy the app to my client's machine it knows that connection string for that implementation ... another for when I'm working with it on my development machine. Third, edit the main form code behind to filter the available databases so that he sees only the databases that apply to his application and keep all of the other ones hidden so he doesn't make a mistake with any databases other then his own. To backup a SQL Server select the database to backup and press the Backup button. This backs up the database and stores its .bak file in the Scratch directory where .NET compression is used to compress it. The .bak file is compressed into a .zip file and copied to the directory you specifiy within the app.config file. I set mine up so that it is copied to by Google Drive so it is synched with offsite storage. To truncate the log file select the desired database and press the Shrink Log File To restore a database select the desired .zip file (the file is named using month day year hour minue and second). It then provides a warning message that identifies the age of the file (in hours) and asked if he really wants to restore from that particular .zip file. The .zip file is then decompressed into the Scratch subdirectory. From there script is writ

    Free Tools database csharp sql-server com sysadmin

  • How bad is it Doc?
    C Charles T Blankenship

    It could be MUCH worse. You could not have a job at all, like myself ... but I'm not here for a sympathy party. I've occupied positions of management as well as positions of programmer (in all various forms). When in a programming position (the nature of which was senior enough to allow me to actually communicate with "management") I took the position of educator. You see, people can become management, usually, not so much because of skill, but because of perseverance. In effect, they were so insecure with their capabilities that when their previous boss finally said "WTF", realized he/she could get a better job somewhere else, and told the current company to FOAD, it is possible that his blooming idiot of a mentor actually made it into management. (Obviously, this is a hypothetical situation ... but it has happened to me several times ... with a couple of different outcomes). In any event, if you ever want to dethrone your resident idiot (RI), you need proof. Therefore, you too must embrace the role of educator. First, every time you talk to the RI and he/she (IT) publicly proclaims their idiocy, make a note of it (or multiple its). Then, in your spare time, (usually on weekends or Holidays ;-), write an article that first, documents the fact that IT said what IT said and then describe, with references, why IT is misinformed ... most importantly, document why this particular misconception is hurting your team's productivity and thereby the profitability of the company). With the last being the most salient point. Remember, your actual audience, is the RI's BOSS. Therefore, you cannot speak too much tech ... but enough to illustrate that the RI is actually an RI. Keep the NATURE of this documentation a TOTAL secret. Communicate only with the RI, via email, with the express understanding that you are trying to HELP IT. However, never forget, you are in a hostile environment. You may think you have friends but there is always that one, insecure "helmut head", that is looking to make his/her way into your position via your decaying corpse. Don't give them any ammunition with which they can expedite your demise. There are two possible outcomes: 1) Your RI is not really an RI at all ... they will take your advice, incorporate it into their management style and graduate from RI to the BEST friend you will EVER have in management. Not to mention, you will have the beginnings of a great tutorial to be used by the next IT hiring on-board. 2) Your RI is really a "BIG"

    The Lounge visual-studio design data-structures security business
  • Login

  • Don't have an account? Register

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