Monday, May 27, 2013

Solved: CLR20r3 mtm.exe System.TypeLoadException

System: Windows 7, MS Visual Studio 10 Ultimate

Summary: Error occurs in the Microsoft Test Manager when I try to open or create a new test case.

Error Returned:
Problem signature:
  Problem Event Name: CLR20r3
  Problem Signature 01: mtm.exe
  Problem Signature 02: 10.0.0.0
  Problem Signature 03: 4ba21172
  Problem Signature 04:
Microsoft.TeamFoundation.TestManagement.Activities.Common
  Problem Signature 05: 10.0.0.0
  Problem Signature 06: 4ba21169
  Problem Signature 07: 32
  Problem Signature 08: e
  Problem Signature 09: System.TypeLoadException
  OS Version: 6.1.7601.2.1.0.768.3
  Locale ID: 1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Solution:

1. Reapply MS Visual Studio Service Pack 1.

2. Apply the hotfix rollup package that resolves the following issues in Microsoft Test Manager 2010 and that is dated October 2010 from Microsoft Support. Downloaded the KB2387011 fix from Microsoft Connect.

3. Check for related Windows Update and install.

Note:
My Silverlight has been affected by the fixes. The Visual Studio notified me that I needed the correct version of the Silverlight. The link for that was provided. Downloaded and installed the compatible Silverlight version.

Sunday, May 26, 2013

How to Key in Product Key in Visual Studio

Your trial period has already expired. You now want to register the product after purchasing a license.

Solution 1:
1. Go to Control Panel via Add or Remove Programs
2. Look for Microsoft Visual Studio <YourVersion>. Right click, then click Uninstall/Change.
3. It will load the installation components. Just wait until you go to the Maintenance Page.
4. At the lowest part of the window, you will see the textboxes to key in the Product Key.

Solution 2:
Here's a much simpler solution. Hehe...

MSDN says, to upgrade from a trial edition of Visual Studio Professional, Premium, or Ultimate, the following simple steps are just what you need to do:

1. Start Visual Studio in Run as Administrator mode.
2. On the menu bar, choose Help, Register Product.
3. Specify the product key, and then choose the Next button.

Wednesday, May 22, 2013

Validate Checkbox using Asp.Net Validator

In the designer / .aspx:


<asp:CheckBox ID="chkAgree" runat="server" />I agree to the <a href="#" class="link-blue"> Terms of Service</a> and <a href="#" class="link-blue">Privacy Policy</a>

<asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ValidateCheckBox" CssClass="field_validation" ErrorMessage="Please accept our Terms of Service in order to avail our services."                 ></asp:CustomValidator>

and the Javascript code:

<script type="text/javascript">
    function ValidateCheckBox(sender, args) {
       if (document.getElementById("<%=chkAgree.ClientID %>").checked == true) 
          {
            args.IsValid = true;
          } 
          else 
          {
            args.IsValid = false;
          }
       }
</script>

Sunday, May 19, 2013

Basic template for Transactions in Sql Server


SET XACT_ABORT ON;

BEGIN TRY
    BEGIN TRANSACTION;

    -- Code goes here

    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    IF @@TRANCOUNT > 0
     ROLLBACK TRANSACTION;

    DECLARE
     @ERROR_SEVERITY INT,
     @ERROR_STATE INT,
     @ERROR_NUMBER INT,
     @ERROR_LINE  INT,
     @ERROR_MESSAGE NVARCHAR(4000);

    SELECT
     @ERROR_SEVERITY = ERROR_SEVERITY(),
     @ERROR_STATE = ERROR_STATE(),
     @ERROR_NUMBER = ERROR_NUMBER(),
     @ERROR_LINE  = ERROR_LINE(),
     @ERROR_MESSAGE = ERROR_MESSAGE();

    RAISERROR('Msg %d, Line %d, :%s',
     @ERROR_SEVERITY,
     @ERROR_STATE,
     @ERROR_NUMBER,
     @ERROR_LINE,
     @ERROR_MESSAGE);
END CATCH

Source