About Me
- Madhan Arcot
- If life is all about change, motion and flow, I would be the one cruising past you on a SunDancer.
Sunday, January 22, 2012
Excel application development on 32 Vs 64 bit Operating System
Now that I am all grown up and all, Excel still saves my day almost regularly. BUT, what might have been a god sent gift growing up, has become a bit of a pain lately while working with Excel files on 64 bit platforms as part of software development.
The biggest challenge to me is the compatibility with 32 bit and 64 bit adapters. Almost every time I wrote a new app that uses Excel as a data source, be it in Java, C#, BizTalk, SSIS, etc I always got stuck at some weird error.
Recently I was writing a quick SSIS project to manipulate data from an Excel file and go this error:
Error: 0xC020801C at Data Flow Task, Excel Source [114]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC00F9304. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
A couple minutes after running through this error I realized I was on a 64 bit OS and had to ensure my SSIS project was not looking for a 64 bit Excel adapter. This is what I had to do to fix this SSIS issue:
· Go to solution explorer
· Right click on project
· Select properties
· Go to debugging tab
· Set Run64BitRuntime to false
How to defragment a file or folder instead of the whole drive
There are multiple situations where you might want to defrag just a folder or a network share, assuming u have admin permissions to do that (No this can’t be used as a prank to mess with your neighbor).
In my case, I was running a BitTorrent on my machine for a while and observed that most of my fragments are under a single folder. I did not want to defrag the whole drive just for this, so I used to wait until I just moved/deleted the contents under that folder.
Recently I came across something simple, yet unpublicized utility from Microsoft which does exactly this. I wonder why people install or pay for some third party software vendor that does this.
Here is how you do this for yourself
Steps:
1. Download contig.exe from http://technet.microsoft.com/en-us/sysinternals/bb897428
2. Create a Defrag.BAT file with the following contents:
DEL Defrag.log
echo Start Time: %time% >> Defrag.log
defrag.exe E:\folder -V >> Defrag.log
echo End Time: %time% >> Defrag.log
Note: in the above BAT file, E:\folder is the folder to be defragged.
Sunday, February 27, 2011
Blog somnia is over
Also, i realised my blog was host to spam comments and ads ranging from viagra to bald hair cure. Apologies for letting such waste of digital media. I promise to do a better job this time :-)
Hopefully i get a chance to share more meaningful information with my friends going forward.
Thursday, October 9, 2008
Distinguished Fields vs. Promoted Properties in Biztalk
Distinguished fields: In general use Distinguished fields if you want to just use them in Orchestration
- No restriction on field length
- No participation in Routing
- No seperate property Schema
- Not accesible by std pipeline components
Promoted Properties: These are generally used with Routing
- Used in publish and subscribe in the Msgbox
- Field Restictions ( 255)
- Seperate Property schema
- Restricted in the XSD types support compared to distinguished properties
Synopsis: Use Distinguish properties as they are lightweight unless you need them for any special stuff like Routing ,Tracking ,Correlation or custom pipeline behaviour
Friday, September 26, 2008
Using Envelope Schema in Biztalk
As most of you aware of the fact that you can either
- Split a single message into multiple messages using Receive pipeline.
- Append multiple mesages into a single message using a Send Pipeline
In both the cases you would need to use an "Envelope Schema" to group them together. Following are instructions how to configure the Envelope schema to achieve the above processes.
Splitting a single message into multiple messages:
You need to create an Orders envelope schema, and Order document schema for that.
Steps:
- Create a new BizTalk project
- Add the Order document schema with OrderId and Date elements
- Add the Orders envelope schema with only root element Orders
- Click on the Schema node and set its "Envelope" property to true
- Click on the Orders node, and click on the body xPath property, choose Orders and click ok.
- Deploy the project
- Create a receive location and choose XmlReceive pipeline
- Open the pipeline properties dialog, and set envelope schema to the Orders schema, and document schema to Order schema
Append multiple messages into a single message: You need to create an Orders envelope schema, and Order document schema for that.
Steps:
- Create a new BizTalk project
- Add the Order document schema with OrderId and Date elements
- Add the Orders envelope schema with only root element Orders
- Click on the Schema node and set its "Envelope" property to true
- Click on the Orders node, and click on the body xPath property, choose Orders and click ok.
- If you are invoking a send pipeline component within an Orch expression: Open the pipeline properties dialog, and set envelope schema to the Orders schema, and document schema to Order schema
- Deploy the project
Friday, September 19, 2008
Compacting a Dynamic VHD image
In order to compact the VHD image to only use the xxx GB which it is actually using, we need to follow this procedure:
- Defragment the VHD you are going to compact: You can do this from within the Virtual Machine.
- Precompact the disk: Once the defragmentation is completed, you need to run Virtual Server’s Precompactor. you can do this by shutting down your virtual machine and mount the Precompact.iso on the virtual machine.
On VirtualServer admin screen go to configuration of the machine and under CD/DVD change the Capture to "Known image files" and select Precompact.iso. Click OK
- Compress the disk: From the VS Admin screen menu, click Inspect and find your VHD and click Inspect.
Thats it, sit back and relax :-) after a couple of minutes(or hours) based on the VHD size, you would find that the VHD is compresses to use the same amount of space as seen from withing the virtual machine.
Tuesday, August 5, 2008
Virtual Server administration website produces a “Page cannot be found error”
I tried to un-install and re-install virtual server software hoping some setting would now be set with the new installation, but that did not work.
I actually rebuilt the operating system and then installed virtual server and bingo it worked. After installing all security patches and services packs, I again got the same “Page cannot be found error”, this basically proved to me that it had to do with some security update, that is causing this issue.
Last week, I read something about a related issue where in a windows security update that restricts access to sites running under default site(port 80) when the files are not under “wwwroot” folder.
I could not create this problem consistently, but definitely solve this problem consistently by doing the following steps:
- Virtual Server by default installs the content to C:\Program files\Microsoft Virtual Server\WebSite\VirtualServer and creates a virtual folder “VirtualServer” under default site.
- COPY(not move) the folder: VirtualServer from “C:\Program files\Microsoft Virtual Server\WebSite\VirtualServer” and paste it under “C:\inetpub\wwwroot\”.
- Now add a new virtual folder with a different alias(say VS) and point it to this folder which you just copied “C:\inetpub\wwwroot\VirtualServer”
- Now try accessing your original Virtual Server administration site or the new one you created and watch it work :-)
One other reason you could be getting the same error would be when you have Virtual server installed and then Virtual PC installed. For some wierd reason these 2 pieces of software donot play well together. In this case, I would suggest uninstalling Virtual PC and see if that helps.
Monday, July 28, 2008
What is ResolveAssemblyReference.cache ?
Well of the many reasons, we found over the last couple of years, recently, i found one more to add to the list.
DETAILS: there is a file created by visual studio called ResolveAssemblyReference.cache, which is created by the newer versions of MSBUILD. The idea of this new feature is to be able to bind to the assembly version while debugging, without having to deploy/GAC the project at all.
If you are not satisfied with the code changes you made, you just have to roll back your code and need not rollback the assembly version which has been deployed/GACed on your system.
WHY did MS implement this?: Kindof like Debugging webpages from your visual studio without having IIS installed on your machine
or
Debug and run a SQL script from your visual studio without having SQL Server on your machine
Just that this functionality created problems for BTSDeploy command line utility, because it used the older version of the DLL that was manually deployed for the package.
SOLUTION: Withing your script, just ensure this cache file is deleted before you dig deeper on why your changes dont take effect.
NOTE: This file can be created only during Compile time not during deployment.
Friday, June 20, 2008
Out of Memory errors while enlisting Biztalk Orchestrations using WMI
Orchestration.enlist is one of most memory consuming task that you could come across while starting applications. When you have many Orchestrations in a single dll, you might come across a 'Out of Memory' error claiming not enough memory is available to complete the transaction, while the server has more than enough memory available.
WMI is used by most management consoles behind the scenes to access certain core functions provided by Microsoft products. Windows Server(2k, 2003) installations come with a smaller memory quota, the default being 128MB for WMI objects.
Problem: When we run trusted scripts, that have to handle large transactions, 128MB is not large enough to complete the transaction and errors out with “Out of Memory” errors.
Solution: There are two ways to solve this:
· Update the appropriate registry(which I still don’t know) setting to a value like 384MB. This can be done HOT and is effective immediately.
· Programmatically increment the ‘MemoryPerHost’ property of the WMI Scripting interface. This would need bouncing the server, before this new quota is effective.
Sample VB Script Code:
'Increase WMI Memory quota from a default of 128MB to 384MB to ensure
'we have enough memory available to complete this process
Dim locator: Set locator = CreateObject("WbemScripting.SWbemLocator")
Dim wmi: Set wmi = locator.ConnectServer("", "root")
Dim quota: Set quota = wmi.Get("__providerhostquotaconfiguration=@")
quota.MemoryPerHost = 384*1024*1024
quota.put_()
Wscript.Echo(quota.MemoryPerHost)
References:
http://blogs.clearscreen.com/tomas/archive/2006/11/13/4234.aspx
http://msdn.microsoft.com/en-us/library/aa394671(VS.85).aspx
How to list files checked out in VSS
We have all gotten ourselves in situations where Visual studio automatically checks out files when opening a solution, even though we did not mean to make any changes to those projects.
This happens because your local version was different from the version in VSS, Visual Studio prompts an alert box asking if it should merge/checkout/ignore the first time, based on your selection it does this same selection for ever.
VSS allows for users to search for all files that have been checked out by any given user, so that we don’t have a file locked up accidentally for ever or until somebody needs it.
· Log in to VSS using VSS client(not visual studio)
· From menus on top: Select View >> Search >> Status Search
· Under Status Search: Select “Display files checked out by user” and select your user-id
· Under Search Area: Select “Search in all projects”
Thursday, March 13, 2008
Cleaning up Biztalk tracking database
To cleanup the tracking database:
If you've never done this procedure before, first do this:
- Open up SQL Server SQL Query Analyzer
- Connect to the BizTalkDTADb database
- "File - Open", and go to the BizTalk Server SDK directory and look for the Database Maintenance subdirectory
- Select the "Purge_DTADB.sql" SQL script file
- Hit F5
- You should see a message "Creating stored procedure dtasp_PruneTrackingDatabase", in addition the status bar below should mark the operation as: "Query batch completed".You have just created a new stored procedure called "dtasp_PruneTrackingDatabase". This procedure allows you to prune the tracking database. It takes only one single parameter: @PruneBeforeDate. Executing this SP causes the tracking data to be purged that was older then the given (@PruneBeforeDate) date. So, let's try this.
- To execute the procedure:
Select: "File - New - Blank Query Window"
Type following statements in order to cleanup *all* tracking data before today:
DECLARE @Today datetimeSET @Today = GETDATE()EXEC dtasp_PruneTrackingDatabase @Today
Depending on how much data is to be purged, after a while the Stored Procedure will notify you with its results. Possibly you may see a message in red, commented as: "Duplicate key was ignored." This is fine and is an expected result.
To verify this:
- Open HAT
- Select: "Reporting - Find Message"
- Try selecting a schema
- If you've cleaned everything, you should not see any schemas anymore... (Only schemas here should correspond to messages that were tracked, áfter the @PruneBeforeDate date parameter.)
If Tracking database is too huge(> 3 GB), it might be better to truncate the complete content in the tables, rather than trying to clean up one row at a time.
Thursday, March 6, 2008
Macros for constructing filenames using Biztalk Send port
The files in which the files send handler writes messages can be created dynamically using a predefined set of macros. Before creating a file on file system, the files send handler substitutes all the macros in file name with their individual values. Several different macros can be used in one file name. The file name macros can be used while configuring the file send handler in BizTalk Explorer, or using the Explorer object model.
Below are the list of Macros that could be used for file send ports to generate meaningful names, rather than just a GUID.