Friday, August 03, 2007

Threads and Cultures

When you create a new thread  you would expect it to inherit the culture information from the original thread since this is the sensible behaviour because you want that thread to access the correct resources and use culture specific formatting etc... But I discoverd in dotnet this is not the case. This also applies to the BackgroundWorker component. So every time you create a thread you have to copy the culture info from the original thread. Strange ......

Friday, July 20, 2007

SQL Server Sri Lanka User Group - July Meeting

We had the SS SLUG july meeting on the 18th. I did a session on SSIS Custom components and dinesh priyankara conducted a session on transaction management. The presentations and samples can be downloaded from here.

Friday, May 18, 2007

MissingManifestResourceException

I came through this strange exception today while refactoring a windows forms application in VS 2005. This was a VB.NET application.  I had to move a usercontrol between projects and doing so I changed the namespace. Suddenly I was getting a MissingManifestResourceException when the control is loaded. The strange thing is there were some other user controls in the same namespace and they worked fine.

Then I inspected the generated assemblies using reflector and discovered that the failing controls resource didn't have any namespace.

After a bit of googling I found this blog entry http://jameswho.blogspot.com/2004/06/missingmanifestresourceexception.html#links this entry suggested changing the default namespace. But I always keep it blank and specify the namespace in each file. Scrolling through the comments there were some suggestions to remove any class or enum declarations that came before the control class. This was exactly the problem I had, there were a couple of enum declarations and a delegate before the control class; after moving them to the bottom of the file it worked fine.

I think this is a bug in visual studio that you have to watch out. It is always a good practice to have only one type in a given source file.

Tuesday, January 02, 2007

ASP.NET 2.0 CSS Friendly Control Adapters

They have released the CSS Friendly control adapters 1.0. If you have ever looked at the code generated by ASP.NET 2.0 controls like the menu and were shocked by the huge tables and inline CSS they generate then these control adapters are for you. They replace the table based layout of the controls with with CSS based implementations using lists/div's/span's and styles. This decreases the amount of markup generated and reduces the page size. Using style sheets also lets you easily change the layout of the controls.

ASP.NET control adapters let you customize the rendering of server controls without writing a new control from scratch of deriving from existing controls. Adapters can be applied based on the user agent and are configured using a browsers configuration  file in the App_Browsers special folder. This lets you integrate the CSS friendly adapters into existing web sites with minor or no modification to the existing pages.

The source code can be downloaded from http://www.asp.net/cssadapters

Logic and Reason: All I've Got Against Moderate Religion

Interesting read...

Logic and Reason: All I've Got Against Moderate Religion

Tuesday, December 19, 2006

Visual Studio 2005 SP1 Released

Finally Microsoft has released a service pack for visual studio. It claims to have fixed many bugs and has performance improvements in the build process. This will certainly be helpful for developers using VB.NET since the original VB.NET compiler crashed frequently and it took unnecessarily long time to compile solutions. Release notes for the service pack is available at http://support.microsoft.com/kb/928957/.

Web application projects are now built in to the IDE. You will have to uninstall the web application projects add on to install SP1.

If you plan to install SP1 its better to go through the release notes first, it can save you a lot of frustration because it seems that there are many workarounds you have to do to get it installed depending on your current configuration.

Tuesday, December 05, 2006

Typed datasets and VS 2005

Recently I had to use typed datasets in a project for the first time. I always preferred using custom entity objects but due to time constraints there was no option on this one. One thing I don't like about the new typed datasets is that it combines the data access code with the data itself if you drag a table from the server explorer into the dataset it creates the connection and the table adapter in the dataset itself, so much for tiered architecture. So I decided the best thing to do is to delete the table adapter from the dataset and just use it as a container.

Another issue that you have to keep in mind when you use typed datasets is that sooner or later you are going to create datasets that share tables among them. If you create the table in each and every dataset its going to create a maintenance nightmare. A better option is to add a xml schema to your project and define all the tables there and include that schema in each of your datasets using the xs:include element. This way you only have to change one file if your table definitions change.

One disadvantage of the above method is that you cannot define keys in the schema, you have to add the keys to each and every dataset. Another minor issue is that the graphical dataset designer gets a bit messed up with this approach. Lets hope the next version of VS comes with a better dataset designer.

Tuesday, November 28, 2006

Auto Door, Please close gently

I saw the above sign pasted on the sliding door of a van while I was on my way to work. It reminded me of hiring a van to go on a trip sometime back. It also had an automatic door and the driver was always screaming at us for slamming the door (I think its bad for the door closing mechanism) but we kept on doing it .

The fundamental principle that the designers of this door violated is that when people get used to something it's very difficult to change. I think that goes double for software UI's, people are used to the existing familiar concepts and that's something we have to keep in mind before we design our next snazzy application.

Saturday, October 21, 2006

Back to SL

Finally its time to go back home to Sri Lanka. I will be leaving for SL tomorrow (20th) a week ahead of schedule. Everything went ok and the project was a success (despite been deployed on Friday the 13th ;-) ).  Norway is a nice place to be but the alcohol is too damn expensive.

Friday the 13th

We went live with out latest project. A web portal based on dotnetnuke last Friday (13th) and it was the 13th build. It was kind of cool going live on Friday the 13th with the 13th build. I am not a superstitious gut it only occurred to me after a colleague suggested that we skip build 13 and go to 14.

Wednesday, October 11, 2006

Update after a long time....................

A lot of things has changed and its an year since I last posted. I work for a new company now namely Eurocenter DDC. These days I am in Norway doing implementation of our latest project. As for the project I think we did a good job and I am confident that it will be a success, as for Norway its a bit too cold for me even though its still autumn and the temperature is around 10 degrees Celsius. I got a sore throught and a fever because of this. But its a nice change, oslo city is good. We went to this amusement park called tusenfryd and tried the speed monster, thats my first time on a roller coaster and I am sure thats going to be my last time too.

Saturday, October 07, 2006

Back with a domain name

I finally got a domain for myself ("chamindu.com"). I got it from godaddy and it's a really good deal with just 9.20 USD per year. My email is hosted in windows live custom domains. All of this started when I was browsing through merills blog and came across this article.

Wednesday, March 23, 2005

Requirement Documents Are There For Reading

Well its 1.00 AM and I just finished fixing some bugs in my code. All of them were there because I missed some of the finer details of the SRS. I wonder, does this only happen to me or ....

Thursday, March 17, 2005

http://www.gothmetal.net/

I found this shoutcast channel while browsing throught the winamp media library. They play pretty cool gothic rock stuff( Bands like NightWish, Lullacry, Within temptation).

And i am looking farward to the rock company's (rock-company.com) 2nd aniversary gig.

After a long time .....

Ok i am going to start again, hope i will be able to post regularly.

Wednesday, October 13, 2004

VSS

For all this time i was wondering why MS is not improving there source control system. if you have ever worked with VSS you know what i mean. Now they have come up with the team system and its about time. But it seems that they have decided to keep VSS. Check out this article by Jonathan Goodyear.

http://www.devx.com/codemag/Article/22031

Tuesday, September 28, 2004

Hello

Check out hello, its a IM and picture sharing tool by google. I think you can also post to your blog using that but i still havent figured that out.

Hello Posted by Hello

Friday, September 10, 2004

ASP.NET Internals

Found this interesting article

http://www.hands-on-labs.com/only4gurus/techlib/microsoft/0735619034_progaspnet_ch02.pdf

it explains how ASP.NET works internally.

Tuesday, September 07, 2004

New workplace

Second day at the new workplace, kind of boring because no work is assigned to me yet. Once you get used to work it can be boring when there is no work really looking forward for something to do.....!

Wednesday, September 01, 2004

InnoSetup

For a long time i was having headaches finding a good installer. I was sick of using the VB's package and deployement wizard, saying it is limited in features is a very mild statement. So then i decided to use visual studio installer somewhat better but still it didnt have the features i need plus there were some problems like the installed programs not working for some users. Then at last i found the installer InnoSetup, its free, simple and has almost all the features you need. The best thing is it is not very complex like most of the commercial installers. Check it out at http://www.jrsoftware.org/isinfo.php