Category: Uncategorized

  • Moving VSTS Load Test Results Databases

    Email from James … :

    Here  is  the full set of steps that you need to go through to view them.  The basic problem is that the connection string to the load test repository is hardcoded into the trx files.

    1. Restore the results database to your local SQL Server 2005 instance.  In theory SQL Server Express (included with the trial DVD that I gave to Andrew) should do the job, but thinking about it you might find a problem restoring due to the file size limitation (depending on what the file sizes were set to on the results server).  In this case you will need to get hold of a copy of SQL Server 2005 Standard Edition.
    2. Create a dummy load test in Visual Studio 2005 (this can just be an empty unit test added to a load test). 
    3. From the ‘Test’ menu, select the ‘Administer Test Controllers’ option.  Under the ‘Load Test Results Store’ section, enter the correct connection details for your SQL Server instance.
    4. Run the dummy load test for a few seconds.  Find the resulting trx file and open it with notepad.  Search for the tag and copy the value (e.g. LAs4ogoKlDc7tK1quR7UVHrc5d598CfIS8AxIDzjz9YaPiknRPEua16x0ZFwpUM6s5UYUAzzrmtpTf26WVVVFVWiAL1CMaOP).
    5. In each of the trx files that you took away from the lab, find the and replace the value with that copied in step 4.
    6. Open the trx file in Visual Studio and right click on the entry in the Test Results window and select ‘View Test Results Database’. The graphs should now be populated from the database.

    The extraction of the resultsRepositoryConnectString value must be done when the database being referenced is moved, or the name of the database is changed.

  • Moving VSTS Load Test Results Databases

    Email from MS:

    Here  is  the full set of steps that you need to go through to view them.  The basic problem is that the connection string to the load test repository is hardcoded into the trx files.

    1. Restore the results database to your local SQL Server 2005 instance.  In theory SQL Server Express (included with the trial DVD that I gave to Andrew) should do the job, but thinking about it you might find a problem restoring due to the file size limitation (depending on what the file sizes were set to on the results server).  In this case you will need to get hold of a copy of SQL Server 2005 Standard Edition.

    2. Create a dummy load test in Visual Studio 2005 (this can just be an empty unit test added to a load test). 

    3. From the ‘Test’ menu, select the ‘Administer Test Controllers’ option.  Under the ‘Load Test Results Store’ section, enter the correct connection details for your SQL Server instance.

    4. Run the dummy load test for a few seconds.  Find the resulting trx file and open it with notepad.  Search for the tag and copy the value (e.g. LAs4ogoKasfgad5T354G25Ga7UVHrc5d598CfIS8xxxxFQW4R34xknRPEua16x0ZFwpUM6s5UYUAzzrmtpTf26Wxxx54Q4QRF).

    5. In each of the trx files that you took away from the lab, find the and replace the value with that copied in step 4.

    6. Open the trx file in Visual Studio and right click on the entry in the Test Results window and select ‘View Test Results Database’. The graphs should now be populated from the database.

    The extraction of the resultsRepositoryConnectString value must be done when the database being referenced is moved, or the name of the database is changed.

  • User & Schema Issues on SQL Server 2005

    Basically, this is due to the new schema / user separation in SQL Server 2005.  By default any users created in SQL Server 2005 will have a default schema of dbo, however for those users that were already part of the restored database, SQL Server 2005 has created a default schema of the same name as the user.  This causes a problem when attempting to delete the users as the drop user procedure (mysp_dropuser) will not drop the schema and a user cannot be dropped if it owns a schema.

    As a solution to this I would like modify the default schemas of all OurProduct® users to dbo.  I would then like to drop those schemas that were automatically created for the existing OurProduct® users.  This will ensure that OurProduct® users do not own schemas.  Therefore, preventing any errors on attempting to delete users in OurProduct®.

    To change the default schema of a user you need to run the following SQL:

    ALTER USER [user] WITH DEFAULT_SCHEMA = [new schema]

    e.g.

    ALTER USER myUser WITH DEFAULT_SCHEMA = dbo

    In order to create the SQL required to do this for all users could you run the following SQL and output the result to text.  You can then run the SQL that is output:

    SELECT 'ALTER USER '+ user_id + ' WITH DEFAULT_SCHEMA = dbo'
    FROM staff s
    JOIN sys.sysusers su
    ON su.name = s.user_id
    WHERE s.is_Deleted = 'N'

    The next part is then to drop those redundant schemas.  The SQL required for this would be as follows:

    DROP SCHEMA [schema]

    e.g.

    DROP SCHEMA myUser

    Again, in order to create the SQL required to do this for all users could you run the following SQL and output the result to text.  You can then run the SQL that is output:

    SELECT 'DROP SCHEMA '+ user_id
    FROM staff s
    JOIN sys.schemas su
    ON su.name = s.user_id
    WHERE s.is_Deleted = 'N'

    One further step that may be required is to re-associate any existing users with the new logins.  To do this, you just need to run the following SQL:

    EXEC sp_change_users_login 'Auto_Fix', '[user]'

    e.g.

    EXEC sp_change_users_login 'Auto_Fix', 'myUser'

    Again, just to generate the SQL required to do this for all users could you run the following SQL and output the result to text.  You can then run the SQL that is output:

    SELECT 'EXEC sp_change_users_login ''Auto_Fix'', '''+ user_id + ''''
    FROM staff s
    JOIN sys.sysusers su
    ON su.name = s.user_id
    WHERE s.is_Deleted = 'N'
  • Compiler Error Message: BC30456: ‘InitializeCulture’ is not a member of ‘ASP.default_aspx’.

    Compiler Error Message: BC30456: ‘InitializeCulture’ is not a member of ‘ASP.xxxx_aspx’.

    Solution: Turn off the option to “Allow this precompiled site to be updateable” when publishing

  • Convert a FAT32 file system to NTFS

    Go to All Programs (from Start), Accessories and Command Prompt.  Type;

    convert C:/fs:ntfs

    in Command Prompt to convert your C Drive. You can do the same for D drive with:

    convert D:/fs:ntfs

  • Updating a dataset in Crystal Reports

    To update a dataset in CR, without losing all the fields on the report do the following:

    • Open the Field Explorer
    • Expand Database Fields
    • Right click the dataset and choose Set Datasource Location…
    • Create New Connection
    • ADO.NET
    • Make New Connection
    • Browse for updated XSD (Class Name and Use Dataset from Class not required).
    • Click Finish
    • Select the same level items in both the Current Data Source and Replace With trees and click Update

    Review the database fields to ensure that the correct values have been passed through.

  • VSS Unspecified Error

    VSS throws up:

    Error: Unspecified error
    File: vsee\pkgs\vssprovider\cmsscciabstractionlayer.cpp
    Line number: 5906

    when it gets confused about the position of projects. Fix:

    • Close the solution and VS.Net
    • Backup solution folder
    • Delete solution folder
    • Delete IIS entries
    • Restart IIS
    • Get latest version from VSS
    • Open solution from SourceSafe location

    This should now work OK.

  • Crystal Report Timeout v10

    Crystal reports (CR) is timing out with v10. This can be fixed by applying the following change to web.config:

    
    
  • Compile and execute code on the fly…

    A simple way to compile and execute code on the fly. From the cmd console:

    notepad code.vb

    This opens notepad with a new file called code.vb

    Paste in a piece of code, for example:

    Imports SystemImports
    System.TextImports
    System.SecurityImports
    System.Security.CryptographyModule
    App
    Sub Main(ByVal argv() As String)

    Dim len As Integer = 128

    If argv.Length > 0 Then
    len = Integer.Parse(argv(0))
    End If

    Dim buff(len / 2) As Byte
    Dim rng As New RNGCryptoServiceProvider()

    rng.GetBytes(buff)

    Dim sb As New StringBuilder(len)
    Dim i As Integer

    For i = 0 To buff.Length - 1
    sb.Append(String.Format("{0:X2}", buff(i)))
    Next i

    Console.WriteLine(sb)
    Console.ReadLine()

    End Sub 'MainEnd Module

    Then save and close notepad.

    Compile the code:

    vbc code.vb

    Execute the code:

    code 128
    code 64

    Voila!!