Thursday, December 30, 2010

Length of LOB data (96896) to be replicated exceeds configured maximum 65536.

Error:

Length of LOB data (78862) to be replicated exceeds configured maximum 65536

Scenario:

We published some articles that use varchar(max) and a lot of XML data types for the columns. When we enabled replication, we got the error Length of LOB data (78862) to be replicated exceeds configured maximum 65536

Solution:

Increase the size that can be replicated. This is applicable for transactional replication only.

T-SQL: 
EXEC sp_configure ‘max text repl size’, 2147483647

SSMS (excerpt from BOL):

    1. In Object Explorer, right-click a server and select Properties.
    2. Click the Advanced node.
    3. Under Miscellaneous, change the Max Text Replication Size option to the desired value.

Reference:

BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/3056cf64-621d-4996-9162-3913f6bc6d5b.htm

Tuesday, December 28, 2010

Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.

during Replication i faced this issue reason was simple that user prefix was not working properly in SQL server 2005. here is how to do it.

This problem occurs because SQL Server 2005 cannot obtain the information about the context when you try to impersonate a database user to run a statement or a module.

SQL Server cannot obtain the information about the context that you are trying to impersonate under the conditions that are listed in the "Symptoms" section. If you impersonate a SQL Server authorization login, SQL Server cannot find a login that matches the security identifier (SID) of the impersonated user. If you impersonate a domain user, the domain controller cannot find the information about the specific user who matches the SID of the impersonated user.

To work around this problem, change the database owner to a valid login or domain user. To do this, run the following statements:

USE
GO
sp_changedbowner ''

Note represents the name of the database. represents the name of the login that you want to set.
http://support.microsoft.com/kb/913423
related one
http://awesomesql.wordpress.com/2010/02/08/sql-error-cannot-execute-as-the-database-principal-because-the-principal-sec_user-does-not-exist-this-type-of-principal-cannot-be-impersonated-or-you-do-not-have-permission/
http://dbaspot.com/forums/ms-sqlserver/354286-event-id-28005-error-15517-a.html
http://dbaspot.com/forums/ms-sqlserver/231821-re-cannot-view-database-properties.html
the best way to do it
http://msdn.microsoft.com/en-us/library/ms176060.aspx
http://forums.devx.com/showthread.php?t=150354

the way to do it
USE databsename
GO
--sp_changedbowner sa Run this first to change the owenber of the database to sa because we are processing with sa account
--ALTER AUTHORIZATION ON DATABASE::EmployeeDB TO sa then run this command to change the authorization schema.

Friday, December 24, 2010

CRM 4.0 IIS 7.5 Unable to Display Static Content

many suggestions like
http://romikoderbynew.wordpress.com/2010/10/27/dynamics-crm-4-0-windows-server-2008iis-7-5-install-problems/
and
http://telligent.com/support/telligent_evolution_platform/community/f/533/t/1059142.aspx
but none of these worked for me then found following article on msdn which was good and it resolved the problem
how to resovle see below.l
To resolve this problem, install the Static Content feature of the Common HTTP Features under the Web Server role on the webserver. If the Static Content feature is already installed, then simply edit the StaticFileHandler mappings using the IIS Manager user interface to add StaticFileModule to the module list.



To install the Static Content feature on Windows Server 2008 and Windows Server 2008 R2, follow these steps:

a. Open Server Manager, and then expand Roles.
b. Right-click Web Server (IIS), and then click Add Role Services.
c. Under Web Server, click to select the "Static Content" check box.
d. Click Next to complete the installation.
Then
To edit the StaticFileHandler mappings, follow these steps:

a. Click Start, type Inetmgr in the Start Search box, and then click Inetmgr in the Programs list.

Note If you are prompted for an administrator password or for a confirmation, type the password or click Continue.

b. In IIS Manager, expand server name, expand Web sites, and then click the web site that you want to modify the settings for.

c. In Features view, double-click Handler Mappings.

d. In the Handler Mappings pane, right-click the StaticFile handler mapping, and then click Edit.

e. In the Edit Module Mapping dialog box, add StaticFileModule in Module box by manually typing it, and then click OK.

Note The default entries in the Module box are StaticFileModule,DefaultDocumentModule,DirectoryListingModule
Source

Wednesday, December 15, 2010

Change Windows remote desktop port number

To change the port you will need to start Windows Registry Editor.
Go to : Start -> Run... type 'regedit' and press OK

Expand the registry folders to:
HKEY_LOCAL_MACHINE > System > CurrentControlSet > Control > TerminalServer > WinStations > RDP-Tcp
Then locate the following registry subkey :
PortNumber

Details Available here

Tuesday, December 14, 2010

String Vs StringBuilder

from my Standpoint I would say string builder is better than strings. rest of the stories can be seen here.

In this post, I am going to discuss about using String Concatenation vs String Builder. I have created a very simple page which creates a string using three different methods.

1) Writes directly to the Response Cache
2) Creates a String variable using String concatenation
3) Creates a String variable using String Builder

I have tried to keep it as simple and self explanatory. Basically there is a string variable called strSample which is 64 bytes in size, and I use simple loops to create strings of the required size and discuss about performance accordingly.

Lets begin by creating an aspx file (say, StringPerf.aspx) in your C:\Inetpub\WWWroot folder (or any other virtual folder of your choice). Now, open StringPerf.aspx in Notepad and paste the following code...

<%@ Page Language="vb" trace="true"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
  <title>StringPerf</title>
  <script runat="server">
'At this point I am declraring a string which is 64 bytes
Dim strSample As String = "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
Dim intListValue As Integer
Dim i As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    Response.Write("<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><HR>")
    intListValue = Val(DropDownList1.SelectedValue)
End Sub
Private Sub btnResponseWrite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Trace.Write("In Response Write before writing")
    For i = 1 To 16 * intListValue
        Response.Write(strSample)
    Next
    Trace.Write("In Response Write after writing")
End Sub
Private Sub btnStringConcat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim strConcat As String
    Trace.Write("In String Concatenation before concatenating")
    For i = 1 To 16 * intListValue
        strConcat += strSample
    Next
    Trace.Write("Length of the string = " & strConcat.Length)
    Trace.Write("In String Concatenation after concatenating")
    Response.Write(strConcat)
End Sub
Private Sub btnStringBuilder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim stbBuilder As New StringBuilder
    Trace.Write("In String builder before building")
    For i = 1 To 16 * intListValue
        stbBuilder.Append(strSample)
    Next
    Trace.Write("Length of the string = " & stbBuilder.Length)
    Trace.Write("In String builder after building")
    Response.Write(stbBuilder.ToString)
End Sub
  </script>
  <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
  <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
  <meta name="vs_defaultClientScript" content="JavaScript">
  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <asp:Button id="btnResponseWrite" onclick=btnResponseWrite_Click style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 104px" runat="server" Text="Response.Write" Width="196px"></asp:Button>
   <asp:Button id="btnStringConcat" onclick=btnStringConcat_Click style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 136px" runat="server" Text="String Concatenation" Width="196"></asp:Button>
   <asp:Button id="btnStringBuilder" onclick=btnStringBuilder_Click style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 168px" runat="server" Text="String Builder" Width="196px"></asp:Button>&nbsp;
   <asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 24px; POSITION: absolute; TOP: 32px" runat="server"
    Font-Bold="True" Font-Names="Arial"> In this sample, we will see the performance difference in using String Concatenation vs String Builder</asp:Label>
   <asp:Label id="Label2" style="Z-INDEX: 105; LEFT: 104px; POSITION: absolute; TOP: 72px" runat="server"
    Width="56px" Font-Bold="True" Height="19">KB</asp:Label>
   <asp:DropDownList id="DropDownList1" style="Z-INDEX: 106; LEFT: 24px; POSITION: absolute; TOP: 69px"
    runat="server" Height="19px" AutoPostBack="True">
    <asp:ListItem Value="1">1</asp:ListItem>
    <asp:ListItem Value="2">2</asp:ListItem>
    <asp:ListItem Value="4">4</asp:ListItem>
    <asp:ListItem Value="8">8</asp:ListItem>
    <asp:ListItem Value="16">16</asp:ListItem>
    <asp:ListItem Value="32">32</asp:ListItem>
    <asp:ListItem Value="64">64</asp:ListItem>
    <asp:ListItem Value="128">128</asp:ListItem>
    <asp:ListItem Value="256">256</asp:ListItem>
    <asp:ListItem Value="512">512</asp:ListItem>
    <asp:ListItem Value="1024">1024</asp:ListItem>
   </asp:DropDownList>
  </form>
</body>
</HTML>

Save the aspx file and browse it. (http://localhost/StringPerf.aspx). You should be able to see a page with a drop down combo box with three buttons called Response.Write, String Concatenation and String Builder. I have turned trace to "true" in the page so that we could see how much time is taken for a similar operation using different methods.

Cool!! Time to start testing :o)

Scenario 1
Combo Box set to 4 KB.

a) Trace With "Response.Write" looks similar to (have a look at the trace generated)

In Response Write before writing 0.00105879378524366 0.000030
In Response Write after writing 0.00112276839654202 0.000064

b) Trace With "String Concatenation" looks similar to

In String Concatenation before concatenating 0.000805130260968922 0.000029
Length of the string = 4096 0.00130072397469511 0.000496
In String Concatenation after concatenating 0.00135128906048115 0.000051
Time taken = 0.00135128906048115 - 0.000805130260968922 = 0.000546158799512228

c) Trace With "String Builder" looks similar to

In String builder before building 0.000985041394925891 0.000030
Length of the string = 4096 0.00104063505277905 0.000056
In String builder after building 0.00106298426196626 0.000022
Time taken = 0.000077942867040369

It looks pretty harmless, isn't it? And in fact for small strings, it doesn't make too much difference anyways. Now look at another scenario. The "Time Taken" what I have calculated above will vary from system to system, but I hope it sohuld give you the idea.

Scenario 2
Combo Box set to 256 KB.

a) Trace With "Response.Write" looks similar to (have a look at the trace generated)

In Response Write before writing 0.000857650902558845 0.000030
In Response Write after writing 0.00188180341356234 0.001024

b) Trace With "String Concatenation" looks similar to

In String Concatenation before concatenating 0.000866590586233725 0.000029
Length of the string = 262144 15.6489126411318 15.648046
In String Concatenation after concatenating 15.6490316506707 0.000119
Time taken = 15.648165060084466275

c) Trace With "String Builder" looks similar to

In String builder before building 0.00103979695743453 0.000029
Length of the string = 262144 0.00564960071740961 0.004610
In String builder after building 0.00575743565173786 0.000108
Time taken = 0.00471763869430333

Now, here comes the difference. And what an amount! String Builder is performing almost ~3317 times faster than String Concatenation (15.648165 / 0.004717)!!!

As you can see the performance dips down drastically. And thankfully, we have an explanation. Visit the following links and enlighten yourself. You may try with different values in the Combo box and see for yourself how badly it can effect your server's performance.

Sources to

http://blogs.msdn.com/b/rahulso/archive/2006/08/29/string-concatenation-vs-string-builder-_2d00_-the-performance-hit_2100_-see-it-to-believe-it-_3a00_o_2900_.aspx

http://support.microsoft.com/?id=893660

http://support.microsoft.com/?id=306821

http://support.microsoft.com/?id=306822

Interesting Discussions

http://channel9.msdn.com/Forums/TechOff/14294-C-string-vs-StringBuilder

http://channel9.msdn.com/Forums/TechOff/211803-Net-String-vs-StringBuilder-metrics

nice and short article

http://blogs.msdn.com/b/msdnstudentflash/archive/2005/01/31/364217.aspx

Detailed explanations

http://www.codeproject.com/KB/string/string.aspx

http://www.codeproject.com/KB/cs/StringBuilder_vs_String.aspx

More blog

http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=site%3Ablogs.msdn.com+string+stringbuilder

A Bit more detail

http://blogs.msdn.com/b/ricom/archive/2003/12/02/40778.aspx

http://blogs.msdn.com/b/ricom/archive/2003/12/15/43628.aspx

Monday, December 13, 2010

Visual Studio Test Professional tutorial

Post Adapted from here

For this tutorial, I’m using Visual Studio Team Suite 2010 (which includes all of the roles and TFS access).  I’ve already added the demo to TFS so I have full source control.  For the sake of demonstration, I’ve commented out the final fix from the walk through so the label does not update:

image

When I run the application, the label is not updated:

image

The Tester

To create my test, I’m going to run the Test and Lab Manager tool from the start menu:

image

The main page has tabs for test plans, tests, and for tracking work items:

image

First I need to connect to my TFS server by click Add.  My server is VLM13267036 (auto generated name by our internal Hyper-V testing tools):

image

I’ve already got a collection with my code stored in the Projects folder:

image

Next I’ll select Projects and choose the Connect option. This prompts me to set a context:

image

I’ll choose “Set context” which brings up the editor for my new context:

image

I’ll select New:

image

I can now edit all of the properties:

image

After all data has been entered, click Save and Close.  The new item is now in our list:

image

Double clicking the item allows me to add a new test case to this test suite:

image

Here you can fill out all details for the test case:

image

Steps can now be added by clicking on the “Click here to add a step”:

image

I’ve added a few steps including launching the application, hitting the buttons, etc:

image

Now hit Save and Close to go back to the test case list.  The Plan is now complete.  We can run it any time a new build is produced, for each flavor of build, for different configurations, etc.  To execute the test, change focus to the Test tab:

image

Our test plan and test case are already in the list.  Right click the test case and select Run:

image

This will launch the test case.  The manual test runner window docks itself to the left side of my desktop so I can see both the steps I want to run and the full Windows desktop:

image

The “Start test and record” option allows me to not only do the testing steps, but it will also allow recording a WMV of all the steps I do as well as recording my steps to help me author coded UI tests (big helper with automation).  This is really handy if you want someone to see exactly what you did to produce a bug and automate testing in the future.

In this case I will select “Start test”.  Notice the Test Runner now shows the steps I created above:

image

The first step is to “Launch the PicViewer application” which I’ll do by running the application.  Since that worked, I’ll press the combo box status item behind the step and select ‘Pass’ from the drop down:

image

The item is now marked as passing:

image

I’ll repeat the process for the next two steps, so far so good:

image

When I get to my last step, I discover the file path isn’t actually set.  That makes this item a failure.  Select the drop down box and choose ‘Fail’ from the list.  I’m automatically asked for comments on the failure:

image

Since I didn’t record a video of my steps, I would like to give the developer a screen shot of what went wrong.  Select the camera tool bar button:

image

This will bring up a capture tool turning the cursor into a cross hair that allows me to select a region of the screen.  I’ll select the top of the application to demonstrate the busted label:

image

Notice that the failed test now has a .png file added with the image:

image

I’ve got enough supporting data now so I’ll create a new bug using the toolbar:

image

I’m now prompted to create my bug with a description, etc:

image

Notice the detailed test steps I’ve taken have already been added to the bug:

image

As has my screen shot (the .png file):

image

I’ll now do a Save and Close which will commit the bug to TFS as a Work Item.  Finally I’ll do End Test then Save and Close the test runner.  This will return us to Test and Lab Manager.

image

as a tester, I could now double click the test case and see all of the same data I just saved for the failure:

image

I can also select My Bugs and see the bug filed for this issue (since I conveniently assigned it to me):

image

And just to show how everything is wired together, I can open Visual Studio, Team Explorer and look for bugs assigned to me there as well:

image

At this point my job as a tester is now done.

The Developer

As a developer, I can now open the bug and read through the issue.  If I select Other Links I’ll find the .png which I can open to see the issue:

image

Sure enough, the label is not updated.  If a WMV had been recorded, I could have actually watched the testing steps in action.  Because the bug is quite simple to find and fix (some idiot commented out the update line!) I can simply make my fix and test it.

Now that things are fixed, I want to check in the bug fix and resolve the work item at the same time.  Click on the Pending Changes tab in VS and select the correct work item:

image

Now we can Check In the fix:

image

I can now verify the bug has been Resolved:

image

In Summary

A key goal for Visual Studio Team System 2010 was to reduce the number of times a tester and developer wind up in a ‘no-repro’ situation.  There are several things I’ve demonstrated in this tutorial which help:

  • Test case steps are documented and set up for repeatable execution
  • Pass/Fail steps are outlined and stored in bugs automatically
  • Video capture is allowed to see all steps taken, and screen snapshots are easy to acquire and file with a bug
  • System information including build number, OS, etc are recorded for you (System Info tab)
  • Although not shown, I could also have collected all of the historical debugging traces from the run as well
  • All data from test cases, results, work items, and source code are kept in TFS and can be shared by test and dev

I hope you’ll pick up Beta 1 and try this set of tutorials for yourself.  Let us know how well it works for you and if you have any suggestions.  I should also point out the work item tracking, auto resolve, etc are all part of VS 2008 so a great way to get prepared for the new version is to get TFS deployed today and get your projects into the system.

Enjoy!

SQL Express 2008 R2 - CREATE DATABASE permission denied in database 'master'

I think I figured it out.  I'm now having a problem importing data (more on that later), but at least I can create a database.  Here's what I did:

1.  shut down SQL Server from services

2.  open cmd window (as admin) and run single-user mode as local admin with this command:

"c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\ sqlservr.exe" -m -s SQLEXPRESS

3.  open another cmd window (as admin)

4.  open sqlcmd:

sqlcmd -S .\SQLEXPRESS

Now add the sysadmin user:

a.  sp_addsrvrolemember 'domain\user', 'sysadmin'

b.  GO

5.  now Ctrl+C the single-user mode from the first cmd window to kill SQL Server.  Now restart it from services the normal way.  Log into Management Studio and the user you created should be listed under logins with the credential of "sysadmin."

Before this, I was getting the error "Only one administrator can connect at this time. (Microsoft SQL Server, Error: 18461)."  What the error utterly fails to tell you is that any connection to single-user mode qualifies as an administrator connection.  In effect, simply opening Management Studio in single-user mode was causing an administrator to connect.  The only way to do anything in single-user mode (it appears) is to do it thru sqlcmd.

Source

http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/76fc84f9-437c-4e71-ba3d-3c9ae794a7c4/

The load test results database could not be opened. Check that the load test results database specified by the connect string for your test controller (or local machine) specifies a database that contains the load test schema and that is currently available. For more information, see the Visual Studio help topic 'About the Load Test Results Store'. The connection error was: An error occurred while attempting to create the load test results repository schema: To create the database 'LoadTest2010' your user account must have the either the SQL Server 'sysadmin' role or both the 'serveradmin' and 'dbcreator' roles

It appears that the load test repository was not created for some reason, so you will need to run the script to create it.  By default, the load test attempts to run against the SQL Server Express database that is installed with VS.  If this database is installed then do the following:

1) Open a cmd prompt
2) Change into the following directory: <VS Install Dir>\Common7\IDE
this will be something like: D:\Program Files\Microsoft Visual Studio 8\Common7\IDE
3) Run the following command: sqlcmd -S .\SQLExpress -i loadtestresultsrepository.sql

Then test the connection the way you originally did with the Administer Test Controller dialog.

If you do not have SQL Express installed on your local machine, you will need to run the installation script on a sql server instance and then configure the run to use the sql server you setup.  The installation script is called loadtestresultsrepository.sql and is located in the <VS Install Dir>\Common7\IDE directory.  After running this script, do the following:

1) Open the Administer Test Controller dialog. 
2) Click the ... next to the connection string
3) Point  the connection to the database you just installed
4) Test connection and hit OK

Source

http://msdn.microsoft.com/en-us/library/ms182600.aspx

Sunday, December 12, 2010

How to uninstall Windows 7.0 SP1 Beta

today  I was about to update my machine with a newer version of Service pack of windows 7.0. I downloaded RC1 and when I clicked on install it said unable to continue a pervious version is installed. so tried a simple way of uninstalling the SP beta but as usual there wasn’t any so this a simple way to do it.

If you've used the Disk Cleanup Wizard since you've installed SP1 RC, the backup files needed to uninstall the service pack might have been removed from your computer. If that's the case, then use System Restore to uninstall the service pack.

  1. Click the Start button .

  2. In the search box, type command prompt.

  3. In the list of results, right-click Command Prompt, and then click Run as administrator.  If you're prompted for an administrator password or confirmation, type the password or provide confirmation.

  4. Type the following: wusa.exe /uninstall /kb:976932

  5. Press Enter.

image

or

The easiest way to uninstall SP1 RC is using Programs and Features.

If you've used the Disk Cleanup Wizard since you've installed SP1 RC, the backup files needed to uninstall the service pack might have been removed from your computer. If that's the case, then use System Restore to uninstall the service pack.

  1. Click the Start button , click Control Panel, click Programs, and then click Programs and Features.

  2. Click View installed updates.

  3. Click Service Pack for Microsoft Windows (KB 976932), and then click Uninstall.

    If you don't see Service Pack for Microsoft Windows (KB 976932) in the list of installed updates, or if the uninstall option is disabled, use System Restore to uninstall the service pack.

Method 2

1. Open Control Panel and click on "Programs -> Uninstall a program" if you are using "Category" view.

If you are using "Icons" view, click on "Programs and Features" icon.

2. Now click on "View installed updates" link given in left sidebar.

3. Select the "Service Pack for Microsoft Windows (KB976932)" item in the given list and click on "Uninstall" button in the toolbar. You can also right-click on the update and select "Uninstall" option.

4. It'll ask for confirmation, click on "Yes" button.

That's it. It'll take some time and will uninstall SP1 Beta from your system.

source for Method 2

Friday, December 10, 2010

How to disable Internet Explorer Enhanced Security Configuration (IE ESC) in Windows Server 2008

To apply Enhanced Security Configuration to specific users by using a computer running Windows Server 2008
  1. Log on to the computer with a user account that is a member of the local Administrators group.

  2. Click Start, point to Administrative Tools, and then click Server Manager.

  3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

  4. Under Security Information, click Configure IE ESC.

    Note

    Server Manager opens with the same window that was in use when it was last closed. If you do not see the Security Information section, click Server Managerin the console tree.

  5. Under Administrators, click On (Recommended) or Off, depending on your desired configuration.

  6. Under Users, click On (Recommended) or Off, depending on your desired configuration.

  7. Click OK.

  8. Restart Internet Explorer to apply Enhanced Security Configuration.

IE_ESC

Post contains Martial from These Sources

http://technet.microsoft.com/en-us/library/dd883248(WS.10).aspx

http://4sysops.com/archives/how-to-disable-internet-explorer-enhanced-security-configuration-ie-esc-in-windows-server-2008/

Thursday, December 9, 2010

how to Delete a BizTalk application from the management db manually

Today i came across a situation where deletion of a BizTalk application throwing some exceptions. as usual it was some timeout expired because BizTalk Administration Tool was unable to delete the resources i think it was due to pipeline which was not deployed properly during import process. i surfed the net and found couple solutions like

http://msdn.microsoft.com/en-us/library/aa577996(BTS.20).aspx

but it did not solve the issues because of the dependencies. I also found a Tool with name BTSZap Available here to manually delete the BTS applications. none of these solved my issue so i did what was the basic approach.

  1. i identified the independent resource of project like pipelines and removed them from application by right clicking then removing
  2. then i deleted all Assemblies which did not had a reference in other assemblies
  3. then i deleted/removed  the rest of the assemblies and then finally i was able to remove the Application

so the job is done now.

some related discussion is available here

BizTalk Server SQL Adapter: Failed to execute SQL Statement. Please ensure that the supplied syntax is correct. New transaction cannot enlist in the specified transaction coordinator.

simple solution : the machine which you are trying to connect as SQL Server make sure its DTC is enable and configured. to enable and configure DTC Type Dcomcnfg in run then select component services –> Computers –> My Computer , Right Click properties MSDTC Tab Configure and start DTC.

image

Security Configuration

image

Wednesday, December 8, 2010

Visual Studio 2008 SP1 Offline Installer

People who do not have consistent internet connection can download complete ISO of SP1 from following link instead of web installer.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en

How-to: Query XML Column Using value

Using SQL Server 2005, I am trying to perform a query on a table that has an
XML column type.
I want to return rows that contain a value within the XML, however it is not
working.
See query below:
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/@LowLimit)[1]', 'int') = 5
The XML in the column is:
<Method xmlns="http://tempuri.org/Method.xsd">
  <Methods>
    <Key>1</Key>
    <Name>PKI</Name>
    <DateCreated>2006-05-01T00:00:00-04:00</DateCreated>
    <DateModified>2006-05-02T00:00:00-04:00</DateModified>
    <LowLimit>5</LowLimit>
    <HighLimit>10</HighLimit>
  </Methods>
  <SubMethod>
    <Key>1</Key>
    <Pressure>10</Pressure>
    <Temperature>25</Temperature>
  </SubMethod>
</Method>

 

Solution

WITH XMLNAMESPACES(DEFAULT 'http://tempuri.org/Method.xsd' )
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/LowLimit)[1]', 'int') = 5

Problem 2

Also I have been trying to query on the similar XML but the current query
using the value() method stops at the first XML tag it sees and doesn't check
the remaiming,.
See XML below.
There is more than one "<Methods>" however using the query:
WITH XMLNAMESPACES(DEFAULT 'http://tempuri.org/Method.xsd' )
SELECT *
FROM XMLTable
WHERE XMLCol.value('(/Method/Methods/HighLimit)[1]', 'int') = 32
It only sees the first "<Methods>" not the ones below it.
I have tried ti use the FLWOR with no success.
How can the query using the vaiue() method be used to propagte down?
If I bump up the the number to 2 in the WHERE clause it only sees the second
"<Methods>" then it will return the row where HighLimt = 32:
    WHERE XMLCol.value('(/Method/Methods/HighLimit)[2]', 'int') = 32
Thanks for any help.
<Method xmlns="http://tempuri.org/Method.xsd">
  <Methods>
    <Key>3</Key>
    <Name>Joe</Name>
    <DateCreated>2005-07-09T00:00:00-04:00</DateCreated>
    <DateModified>2006-03-15T00:00:00-05:00</DateModified>
    <LowLimit>1</LowLimit>
    <HighLimit>8</HighLimit>
  </Methods>
  <Methods>
    <Key>4</Key>
    <Name>Mary</Name>
    <DateCreated>0200-05-12T00:00:00-04:00</DateCreated>
    <DateModified>2004-07-30T00:00:00-04:00</DateModified>
    <LowLimit>18</LowLimit>
    <HighLimit>32</HighLimit>
  </Methods>
  <SubMethod>
    <Key>1</Key>
    <Pressure>10</Pressure>
    <Temperature>25</Temperature>
  </SubMethod>
  <SubMethod>
    <Key>2</Key>
    <Pressure>20</Pressure>
    <Temperature>100</Temperature>
  </SubMethod>
</Method>

 

Solution 2

Have found (through DataPoints download 
http://msdn.microsoft.com/msdnmag/issues/06/03/DataPoints/default.aspx)
can use the exists() method to perfom the search throughout the XML document:

WHERE XMLCol.exist('/Method/Methods/LowLimit[contains(.,"18")]') = 1

Source and this and this

My Tip do not mention namespace if you don’t have any Schema for your XML

Performance optimization of a Virtual Machine

Everyone uses Virtual machine now a days some as development environment others as testing environment. however many users who are not using latest HyperV technology still face slow performances for the VM. in my opinion following things can improve the performance of a VM

  1. Stop all unnecessary services. like indexing services or SQL server related services if not required.

Source

  1. if you do not need network do select the option no local area network. it impacts a lot since the congestion on LAN make the VM a non responsive.
  2. make sure you are using unique name for the VM over LAN to avoid continuous network errors.like duplicate name
  3. increase the page file size so that host could easily process the VM data.
  4. make sure that from VM software options you are using following options for best performances.

VMoptimization

Infragistics Ultra Web grid Hidden property

in web application we need to hide show rows in an infragistics. web grid initially property hidden was used for this purpose however in version 10.2 now its a method setHidden which is used to hide or show a Row in infragitcs web grid.

as per documentation

setHidden

Sets the row visibility.

Parameters
h

Boolean. True to hide row.

Source

BizTalk Mapping with Multiple Source and Destination Schemas

If you are already familiar with the BizTalk Mapper tool within Visual Studio, you probably already know that it is easy to create a .btm map file in the BizTalk project, select a single source schema and a single destination schema, and then create your map graphically. However, what if you have multiple schemas that you want to aggregate them into a single destination schema, or better yet, into multiple destination schemas. It is not obvious how you can accomplish this in the mapping tool since it doesn’t seem to allow you to select more than one schemas, either source or destination, when you create the map. Actually, this can be accomplished with the help of an helper orchestration.

Here are the steps as an example:

  1. Create 4 schemas, name them source1, source2, destination1 and destination2 respectively.
  2. Instead of creating a map file (.btm) directly, create a new orchestration (.odx) file. This will be your helper orchestration and you can discard it after you are done.
  3. Inside the helper orchestration, create 4 messages, assigning them with the 4 schemas you create in step 1 respectively.
  4. Grab an Transform shape and throw it onto the orchestration designer surface.
  5. Double-click on the Transform shape, now you are in the Transformation Configuration dialog box.
  6. Make sure “New Map” checkbox is selected, then type in the map name you’d like.
  7. Add source1 and source2 messages as the Source of the Transformation.
  8. Then add destination1 and destination2 messages as the Destination of the Transformation.
  9. Make sure “When I click OK, launch the BizTalk Mapper” checkbox is selected.
  10. Hit OK. A new map will be created for you with Source1 and Source2 as source schemas under a single root record, and destination1 and destination2 as destination schemas under a single root record as well. Now you can go ahead design this map to your heart’s content.
  11. Optionally, again, you can delete the helper orchestration.

Unfortunately there is still no direct way to create this kind of maps in BizTalk Mapper. But with the help of an orchestration Transformation shape you can accomplish this as a work-around.

 

Source

Ultra webgrid Row Numbering

Today i had to add some row numbers to an ultrawebgrid although it was simple but now a day infragistics support is really not good so you have explore and implement. during research i come to know that there is a property of AllowRowNumberingDefault in displayLayout section of grid is responsible to Row numbers. now if you want this row number to be continues over several pages you need to set is AllowRowNumberingDefault = "Continuous" . this property is also available at band level so that you could set it on a certain band level. now if you want to use the row number at client side you need to set another property in displayout section with name EnableClientSideRenumbering = "true"  it can also be set at band level in some version but in my case where i am using 2007.2 it was only at displayout section.

one more thing to remember when trying to show Row numbering you need to set rowselector property to true otherwise these number will not appear because the row number is displayed on selector of the row.

Link which help me in this context.

Tuesday, December 7, 2010

Allow more than one remote desktop session for Windows server administrator



Scenario:

Allow more than one remote desktop session for administrator on default installation of windows server 2008.

Solution:

Start Remote desktop to the Windows server 2008
Start->Run-> gpedit.msc






 
 
 
 
 
 
 
 
Please follow the steps as shown in the screens below.



















Source