An enhanced UpdateProgress control, which shows an animation at the point where mouse was clicked

Also Check Out: My latest venture. http://loqly.me – a way for you to ask questions and get answers about local businesses around you. iTunes link:http://bit.ly/e5u4jv (only available in US for now)

WHY DO IT ???

Before you read the post, let us answer why did I waste time in changing the behavior of the UpdateProgress control. Here is the deal. Suppose, you have 5 or 6 controls on your page, which when clicked result in an Ajax call. You know that the UpdateProgress control is pretty much static, meaning, wherever you put the <asp:UpdateProgress> tags, that is the place where the progressbar will show up when your Ajax call is in progress. So, no matter which control the user clicks the progressbar is being shown in a fixed place. Why may some people consider this bad ???

  • You or anyone looking at the screen, may lose track of why you are waiting because the progressbar just shows that you are waiting not what has triggered the wait.
  • If the page is long, and the progress bar is at a fixed place, there is a possibility that you clicked a control which is a scroll length away from where the progressbar will show.
  • If the control which was clicked can give a feedback for the user to wait, it prevents the user from clicking the same button twice.

So, much for justifying why I wrote this control. But those were just a few thoughts behind it. Let us get back to the nitty gritties. Btw, here is a YouTube vide of how it looks (video is a little fuzzy but it shows what I am trying to communicate)

The Code :

I will not go into too much detail explaining the code, because I am sharing the source code with you. But here is the high level overview :

  • Create a new control, which inherits from UpdateProgress control
  • Embed two resources in your control assembly. (the default hourglass image and the javascript used to make this control work)
  • Override Render method, and inject javascript. The javascript will hook into the AJAX InitializeRequest and EndRequest events, by calling add_initializeRequest() and add_endRequest() methods of Sys.WebForms.PageRequestManager class.
  • The first Image control in the <ProgressTemplate> of the UpdateProgress control will be assumed to be the hourglass image, and if you haven’t set an ImageURL value for it, a default image will be supplied. You can create your own hourglass images from this awesome website : http://www.ajaxload.info/#preview

That is it. Do leave comments and suggestions if you find this control useful. I am also attaching the source code and the assembly. If you don’t want to see the code, just use the assembly and things should work right away.

Advertisements

Migrating Sourcesafe database from one server to another in 5 steps

UPDATE: The easiest way to move a VSS database to a new server is to copy the whole database in one shot. If your database is small this works like a charm. See this MS KB article for details. The only gotchas are :

  1. This involves copying the complete VSS folder over the network. This may be slooooow and the file copy may even fail suddenly for no reason.
  2. If the VSS db is real big then even winzip will stop at 65K files, so rule out that option if the no of files > 65K. Even winrar doesn’t work. I haven’t tried Lharc or ARJ yet.

    —————————————————————————————-

    Original Post

    If you have found this article, it means you haven’t had much luck trying to find how to migrate VSS from one machine to another. Also, many of you must have noticed that MS KB article http://support.microsoft.com/kb/q176875/ is bogus and the syntax for ssarc does not work. So, how do you actually move your VSS sourcesafe database ????

    STEP 1: Use SSARC.EXE to archive your existing database.
    Here is the syntax which I got working for me after umpteen trial/errors :
    ssarc “-s\\vssserver\vssfolder” d:\Archive.SSA $

    1. Notice that -s is inside the quotes
    2. $ means the whole VSS should be archived starting from root. You can specify sub branches too. eg. $/Projects or $/Project/Project1
    3. Make sure you enter ‘N’ (NO) when ssarc asks you if you want to delete the existing database after it has been archived.

    STEP 2: Run SSRESTOR.EXE to restore the database on the new server.
    ssrestor “-s\\NewServer\VSS” d:\ArchivedProjects.ssa “$/PathYouWantToRestoreTo”

    STEP 3: Copy existing users from your current VSS installation.
    Copy VSS\Users folder, VSS\Users.txt file and Um.dat file to the new installation

    STEP 4: Run Analyze -F “C:\Program Files\Microsoft Visual Studio\VSS\Data. This will re-generate the rights for all the users based on um.dat. Remember you just cannot simply copy rights.dat file to do this.

    STEP 5: You can either change the current srcsafe.ini to point to the new database, so that developers don’t get a broken link. Or you can just shutdown the server and tell people to reload their projects from the new server.

    Thats it. When you complete step 5….your VSS migration is complete !!!!

    Further Reading:—————

    Problems/Fixes for integrating VSS with Interdev:
    http://www.codeproject.com/asp/VSS_and_VID.asp?df=100&forumid=136229&select=1313406&msg=1313406

    User right setup for VSS:
    http://support.microsoft.com/kb/131022/EN-US/

    Use of http://codebetter.com/blogs/darrell.norton/archive/2004/04/15/11493.aspx vss binding remover on developer’s machines to get rid of .scc files

    CREATE DATABASE permission denied in database ‘master’. An attempt to attach an auto-named database for file XXX failed.

    problem : I had a perfectly running ASP.Net 2.0 website with SQL Express on a Virtual PC (Windows 2k3 Server). I copied the Website to a different machine (Vista) and copied the database (MDF and LDF files) to App_Data folder of the website in the new machine.

    I am using the following connectionstring to generate a user instance of the database.

    <add name=”LocalSqlServer” connectionString=”Data Source=.\SQLExpress;Integrated Security=True;User Instance=False;AttachDBFilename=|DataDirectory|aspnetdb.mdf”/>

    CREATE DATABASE permission denied in database ‘master’. An attempt to attach an auto-named database file XXX.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

    Also, I wanted to mention that I tried attaching the .mdf file directly to SQL Server using the Attach option and that failed with “operating system error (5) access denied“, even though I made SQL Server service run under an Admin account.

    The Solution : The reason why the user instance was not getting generated was because my app pool for the website (in this case it was Default App Pool) was running under Network Service. If I change the account to Local System, everything starts working. I did give Network Service access to the Website, but that didn’t work.

    I still haven’t found a solution for the access denied while trying to attach the mdf file to SQL server. If anyone finds a solution kindly post a solution in the comments. If I find it myself, I will update the blog entry with the solution.

    UPDATE : 6/4/2008 – If you are running Windows Vista, make sure you right click on SQL Management studio and choose “Run as administrator”. That normally solves half of the problems.

    Migrating Sourcesafe database from one server to another in 5 steps

    Also Check Out: My latest venture. http://loqly.me – a way for you to ask questions and get answers about local businesses around you. iTunes link: http://bit.ly/e5u4jv (only available in US for now)


    UPDATE: The easiest way to move a VSS database to a new server is to copy the whole database in one shot. If your database is small this works like a charm. See this MS KB article for details. The only gotchas are :

    1. This involves copying the complete VSS folder over the network. This may be slooooow and the file copy may even fail suddenly for no reason.
    2. If the VSS db is real big then even winzip will stop at 65K files, so rule out that option if the no of files > 65K. Even winrar doesn’t work. I haven’t tried Lharc or ARJ yet.

    —————————————————————————————-

    Original Post

    If you have found this article, it means you haven’t had much luck trying to find how to migrate VSS from one machine to another. Also, many of you must have noticed that MS KB article http://support.microsoft.com/kb/q176875/ is bogus and the syntax for ssarc does not work. So, how do you actually move your VSS sourcesafe database ????

    STEP 1:  Use SSARC.EXE to archive your existing database.
    Here is the syntax which I got working for me after umpteen trial/errors :
    ssarc “-s\\vssserver\vssfolder” d:\Archive.SSA $ 

    1. Notice that -s is inside the quotes
    2. $ means the whole VSS should be archived starting from root. You can specify sub branches too. eg. $/Projects or $/Project/Project1
    3. Make sure you enter ‘N’ (NO) when ssarc asks you if you want to delete the existing database after it has been archived.

    STEP 2: Run SSRESTOR.EXE to restore the database on the new server.
    ssrestor “-s\\NewServer\VSS” d:\ArchivedProjects.ssa “$/PathYouWantToRestoreTo”

    STEP 3: Copy existing users from your current VSS installation.
    Copy VSS\Users folder, VSS\Users.txt file and Um.dat file to the new installation

    STEP 4: Run Analyze -F “C:\Program Files\Microsoft Visual Studio\VSS\Data. This will re-generate the rights for all the users based on um.dat. Remember you just cannot simply copy rights.dat file to do this.

    STEP 5: You can either change the current srcsafe.ini to point to the new database, so that developers don’t get a broken link. Or you can just shutdown the server and tell people to reload their projects from the new server.

    Thats it. When you complete step 5….your VSS migration is complete !!!!

    Further Reading:—————

    Problems/Fixes for integrating VSS with Interdev:
    http://www.codeproject.com/asp/VSS_and_VID.asp?df=100&forumid=136229&select=1313406&msg=1313406

    User right setup for VSS:
    http://support.microsoft.com/kb/131022/EN-US/

    Use of http://codebetter.com/blogs/darrell.norton/archive/2004/04/15/11493.aspx vss binding remover on developer’s machines to get rid of .scc files