Friday 25 January 2008

Visual studio 2008 professional edition

Hello all,
Today i have received a 90-day evaluation pack of visual
studio 2008 Professional edition. I have been reading a lot about the
said edition, and the latest and some cool features, it has to offer. I
think 90 days is too little a time for a professional like me, who
hardly has some time after coming from a long day at work, to try out
new things. But guess what, i have decided that i will spend atleast an
hour on the new version to make sure, i utilize the complete 90 days to
the maximum.
Will keep you all posted of anything cool, or may be any glitches from the new software.
So keep checking back, and till then chao!

Powered by ScribeFire.

Sunday 20 January 2008

Mix n match C# and VB codes in a single project

Got this wonderful stuff from http://www.aspnetlibrary.com

Whilst it isn't ideal to both mix C# and VB.NET languages in the same ASP.NET project, it is possible. The code still has to be separated and it can't be mixed at page level but you can create a class in each language and then use and reference them both from any page.

To do this, you'll need to follow a few simple steps.

Step 1

Create an App_Code folder if it doesn't already exist. Then, inside this folder create two other folders to hold each language type. For example,

App_Code
vbcode
cscode

Step 2

Edit your web.config file and make sure the following section is added:

<system.web>
<compilation>
<codeSubDirectories>
<add directoryName="vbcode"/>
<add directoryName="cscode"/>
</codeSubDirectories>
<compilation>
</system.web>

<system.web>
<compilation>
<codeSubDirectories>
<add directoryName="vbcode"/>
<add directoryName="cscode"/>
</codeSubDirectories>
</compilation>
</system.web>

Add each class to the relevant folder and you're done! You can now reference any of the classes in the standard manner and ASP.NET will do all of the compilation automatically for you.

Wednesday 16 January 2008

Distributed Transactions in MS SQL server 2005

I was developing a .net 2.0 web application with SQL 2000, and used TransactionScope. The machine had the access to database on server through LAN. Everything was working fine, and we had no problem. Then came the upgrade for the SQL server. We decide to roll out 2005 edition of MS SQL and this is where the problems started.
SQL 2005 does not by default allow distributed transactions, so if you are using nested transactions, which could be TransactionScope as well, it will bug up. After a bit of digging up, I found out following steps to get around this bug! So here they are.

First verify the "Distribute Transaction Coordinator" Service is running on both database server computer and client computers

1. Go to "Administrative Tools &gt; Services"
2. Turn on the "Distribute Transaction Coordinator" Service if it is not running

If it is running and client application is not on the same computer as the database server, on the computer running database server

1. Go to "Administrative Tools &gt; Component Services"
2. On the left navigation tree, go to "Component Services &gt; Computers &gt; My Computer" (you may need to double click and wait as some nodes need time to expand)
3. Right click on "My Computer", select "Properties"
4. Select "MSDTC" tab
5. Click "Security Configuration"
6. Make sure you check "Network DTC Access", "Allow Remote Client", "Allow Inbound/Outbound", "Enable TIP" (Some option may not be necessary, have a try to get your configuration)
7. The service will restart
8. BUT YOU MAY NEED TO REBOOT YOUR SERVER IF IT STILL DOESN'T WORK


On your client computer use the same above procedure to open the "Security Configuration" setting, make sure you check "Network DTC Access", "Allow Inbound/Outbound" option, restart service and computer if necessary.

On you SQL server service manager, click "Service" dropdown, select "Distribute Transaction Coordinator", it should be also running on your server computer.



Powered by ScribeFire.