Archive for January, 2011

January 19, 2011

WSCF.blue

This is a Visaul Studio .NET 2008 add in that we can use to generate data contracts of a schema (XSD types). Earlier we were using the XSD2Code generater to generate our contracts but it lacks some features such as ordering, etc. In that case we have to do those modifications manually. Finally the WSCF.blue is a good tool and we don’t have to do anything manually. Using the wizard we can accomplish what we need.

you can download the tool from codeplex.

January 18, 2011

Missing Orchestration Files templates in Visual Studio 2008

I couldn’t find the Orchestration Files template in VS 2008 when i tried to do some testing projects today. It was there and couldn’t understand why it did disappeared suddenly.

without the orchestration templates :

just run the command  using the Visual Studio 2008 command prompt :  devenv /installvstemplates to reinstall your templates for VS 2008.

after running the above command :

January 13, 2011

Auto Increment field value by using UPDATE statement.

When creating tables in SQL Server we can specify particular field to be auto incremented, specifically the primary key field. For this purpose MS SQL Server uses the IDENTITY keyword to perform an auto-increment feature. By default, the starting value for IDENTITY is 1, and it will increment by 1 for each new record.

But if you need to change the value to be started with a specific value, then you can just simply specify as below:

IDENTITY(10,5)

in this case the value will start from 10 and incremented by 5 each time when a record is being getting inserted in to the table.

Ex:

CREATE TABLE Persons(
EmployeeId int PRIMARY KEY IDENTITY(10,5),
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255))

I was in a situation where i had to do the same thing as mentioned above to an existing table where do some data exist.

What i did was just inserted the records to the table except the primary key. It means temporarily i just allowed NULL to be inserted to the primary key column. After that just update that primary key values by simply running a update statement as below setting the value the primary key should start with.

DECLARE @counter int
SET @counter = 50
UPDATE [Test].[dbo].[Test]
SET @counter = [EmployeeId] = @counter + 1
January 12, 2011

Cannot create new BizTalk projects in Visual Studio Team System 2008

Suddenly I was unable to create BizTalk projects or even I was  unable to open existing BizTalk projects in my machine. Visual  Studio Team System 2008 started getting strucked when I started to do so.  I checked the event log and there was no events at all something related to VS 2008. But when I googled in some forum posts in MSDN says that when Visual Studio 2008 is repaired or when a Visual Studio 2008 update is installed, the value of the following registry entry is changed from csproj;btproj to csproj:

Location of those registry entries as below:

  • For 32-bit versions of Visual Studio 2008:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\PossibleProjectExtensions
  • For 64-bit versions of Visual Studio 2008:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\PossibleProjectExtensions

For you to resolve the error just Update Value data in the Edit String dialog box to include the btproj project extension in addition to the csproj. So the finally entry in the value data should be csproj;btproj.

But in my case the registry entry was okay and correct.

So finally decided it may due to some corrupted installation files and just repaired the BizTalk installation. Finally I was able to open all my BizTalk and new BizTalk projects without any hassle anymore. J

so i started blogging for 2011 🙂