Tuesday, December 26, 2006

Once again i felt that i am not alone.

Thanks for all the people who remembered the day... :)

Wednesday, December 20, 2006

Back !!!

OH! I haven't come here for more than one month.I think I have really miss my blog hehehe.So wazz up with me? mmmmmmm

well I have moved in to C#.Net.(You was waiting to hear it from me. isn't it charith ? lol)I was working with VB.Net more than 2 years.But because of the new project that we have got we had to move in to C#.I have no choice.anyway it's pretty cool thing.

I miss Deep dive .NET 3.0 I always missing important things I do not know what's wrong with me.anyway hope to be alive with ma blog again.and bring up new things here.

cheers !!!

Wednesday, November 01, 2006

Microsoft has announced Light Weight Open Source Applications(Online)

October 30th Microsoft has released a free downloadable accounting program called Office Accounting Express 2007. This software focuses on integrating with online sites like eBay, PayPal and Office Live. See for comparison Google’s partnership with Intuit.

And 31st of October they have announced that the first version of Office Live will come as beta version on the 14th of November. Office Live is a free service with premium services for small businesses. It includes online storage, webmail and calendaring.

What will be next.....

Read more at Techcrunch.

Thursday, October 19, 2006

The Difference ...

Found a Nice story from my emails today..... I just wanted to bring it out here ,because I feel it's special.

Little girl and her father were crossing a bridge.
The father was kind of scared so he asked his little daughter, "Sweetheart, please hold my hand so that you don't fall into the river."
The little girl said, "No, Dad. You hold my hand."
"What's the difference?" Asked the puzzled father. "There's a big difference," replied the little girl.


"If I hold your hand and something happens to me, chances are that I may let your hand go. But if you hold my hand, I know for sure that no matter what happens, you will never let my hand go."


In any relationship, the essence of trust is not in its bind, but in its bond .
So hold the hand of the person whom you love rather than expecting them to hold urs...

Wednesday, October 18, 2006

Nikhil Kothari's Ajax.net presentation on JAOO 2006 Conference

Here is the link for nikhil Kothari's presentation on ASP.NET AJAX at the JAOO 2006 conference in Denmark.(In case you didnt visit Nikhil's Blog recently ;-))

And you can download the video of it from.....

http://channel9.msdn.com/Screencasts/243775_JAOOLapAroundAtlas.wmv

Tuesday, October 17, 2006

Save Your eyes !!!

Normally I use anti-reflect Lenses when I am working.But last 2 days I forgot to bring it. So I feel bit uncomfortable when I am working.One of my office buddy gave me a article about what you can do with your Monitor to Save your Eyes. So I felt it's worth while to bring out some information out here......

By side staring at my monitor hour after hour Cause headaches and eye fatigue.according to the article one of simple thing we can do to help this problem is to raise the refresh rate. Monitors often come with refresh rates set too low, I.e. 60 Hz which causes flickering. A higher refresh rate helps reduce the flickering effect and lessen eye strain.(More than 75Hz).(You can usually set your refresh rate under display properties/settings. Also, RefreshForce is a free tool that lets you quickly change the monitor's refresh rate.)

Another cause of eye strain that many people tend to just live with is font size. Higher resolutions on monitors can cause quite small fonts. Also, many web sites use small fonts. If you catch yourself leaning toward the monitor, or squinting uncomfortably, right click on your desktop to bring up display properties, select appearance, and choose font size. You can further adjust the font you see when surfing by choosing text size from Internet Explorer's view menu and selecting your preference. This may cause some of your favorite web pages to display a little oddly, but at least you'll be able to read them!

Make sure you have proper lighting on your monitor (it's more effective to have a light shining from behind your shoulder or above the monitor than behind the desk).

Even using these measures, we should take frequent breaks from the computer. Look away from your monitor at least once every fifteen minutes; preferably, step away from the computer altogether.

So try to take care of your eyes too,while you are working

Friday, October 13, 2006

After the silence....

Well, I couldn't write anything during the last 2 ,3 weeks. Many changes have been going on in ma life since that period(still the same :)). I never thought this will happen to me. For the first time I'm fed up with ma Job. And I have to tnx all my friends who were with me for all this time. It helped me a lot. I got loads of advice what I have to do in such a situation.

Anyway that's enough about that. The good news is two of my buddies have started their own Blogs. (Suresh and vajira). So good luck yo buddies. Welcome to blogging.. lol..

So now what I have to do is try to cheer up and continue my life. Isnt it?? But I'm still trying ....

Thursday, September 28, 2006

Ashi has came back...

One of ma good friend; ashini(Akki) has came back to blogging again ('coz of my request. ;-) ) She's a very close friend of mine and a good sister for me. I always try to accept all her advice ;) (even though you think you are not a good adviser. lol...) and those advice is worth for me. I have changed some qualities of mine. he he he... As my knowledge we don't know how much we are worth for others. So you have to start a new blog life with all your thoughts, and with your knowledge (which is being updated daily... ). So wish you all the best Akki !!!

You can visit her blog.... http://ashinie.blogspot.com/

Thursday, September 21, 2006

Common Table Expression(CTE)

This is a new Enhancement of SQL server 2005(as my knowledge).we can think CTE's as a simple and more powerful alternative to derived Tables.In my case Now I am using CTE's where I used Temporary Tables before and I replaced so many views.

A CTE can be defined as a temporary named result set, which is derived from a simple query and defined within the execution scope of a SELECT, INSERT, UPDATE, or DELETE statement. It is important to note that the scope of a CTE is just the statement in which it is declared. The CTE named result set is not available after the statement in which it is declared and used.

Here I am putting a code sample for CTE witch I have taken from AdventureWorks Database then you all can check this SQL script in your SQL server 2005(if you have installed AdventureWorks DB.)


WITH YearlyOrderAmtCTE(OrderYear, TotalAmount)
AS
(
SELECT YEAR(OrderDate), SUM(OrderQty*UnitPrice)
FROM Sales.SalesOrderHeader AS H JOIN Sales.SalesOrderDetail AS D
ON H.SalesOrderID = D.SalesOrderID
GROUP BY YEAR(OrderDate)
),
SalesTrendCTE(OrderYear, Amount, AmtYearBefore, AmtDifference, DiffPerc)
AS
(
SELECT thisYear.OrderYear, thisYear.TotalAmount,
lastYear.TotalAmount,
thisYear.TotalAmount - lastYear.TotalAmount,
(thisYear.TotalAmount/lastYear.TotalAmount - 1) * 100
FROM YearlyOrderAmtCTE AS thisYear
LEFT OUTER JOIN YearlyOrderAmtCTE AS lastYear
ON thisYear.OrderYear = lastYear.OrderYear + 1
)
SELECT * FROM SalesTrendCTE
GO

Monday, September 18, 2006

Down with a fever... and now Gastritis....

Now I feel bit better after the fever since last Wednesday. I wanted to be @ office last thursday and friday coz I had to complete something with new SQL Report server. But I couldn't make it. After the fever last friday i got Gastritis also. Now I have to take medicine for Gastritis too.That's a damn sickness. NowI feel bit better. And now I am trying to Eat on time. And I am warning you all my buddies. Please take care of your meals. Simply EAT ON TIME.

Tuesday, September 05, 2006

Microsoft .NET Framework 3.0

Microst has Released Microsoft .NET Framework 3.0(pre-Released) for the general public.(May be this an Old news ;) ).We can download new framework and Related resources from here. and also we can download RC1 SDK tooo.Wow.....

Thursday, August 31, 2006

Tutorials on Enterprise Library

These days i got a chance to start working with one of the tool witch i was dreaming to work with.Enterprise Library.When i am Searching for Tutorials for Enterprise Library i found Some great Great articles.So i thought to share them with you all.

The Enterprise Library Data Access Application Block

Online Tutorials about Enterprise Library

Using the Enterprise Library Data Access Block for .NET 2.0

And some Links was available in Angelos Petropoulos' WebLog

(archive Tutorials on using Enterprise Library )

Saturday, August 26, 2006

Upuli got Married


One of ma good friend Upuli got Married y’day.wedding was @ koggala beach Hotel.

Hmmm very nice to see you as a bride buddy. Hope you will get all the happy things in your new life.

Best wishes to both of you !!!!.


The best Is yet to come lu ne????

Congrats..... !!!

Wednesday, August 23, 2006

I just started photo sharing

I started my old habit again.but still didnt feel much comfortable on it.anyway hope you all will help me to improve.i always welcome your comments on it.I just started my photosharing at flickr.com.And click here to go to my photo sharing at flickr.com.


cheers

Tuesday, August 22, 2006

What can we do for this?As a Sri Lankan








Here are some pics witch i have got from one of my friend.can u understand how much Tamil people are in Canada supporting to establish "EELAM" as their homeland. See how our flag has been disgraced by Tamils can we call them as Sri Lankans ?????

Wednesday, August 02, 2006

Creating thumbnail Image(VB.NET)

I wanted To Create a thumbnail Image from Original Picture And save it in Employee Data.I used image.GetThumbnailImage function to sort this out.So i thught to Publish it here ,it will be a Help for someone else.



' Photo path(Actual path to Uploaded Pic)

Public Shared Function CreateThumbnail(ByVal imagePath As String, ByVal Folder As String) As Boolean

Dim createdThumbnail As Boolean = False

Dim thumbnail As Image

Dim image As Bitmap



Try

' get full path to the thumbnail image

Dim thumbnailPath As String = Path.Combine(Folder, GetThumbnailName(imagePath))



' check thumbnail already exist

If Not File.Exists(thumbnailPath) Then

image = New Bitmap(imagePath)

' create thumbnail image

thumbnail =GetThumbnail(image, 120)



' save thumbnail

thumbnail.Save(thumbnailPath, ImageFormat.Jpeg)



createdThumbnail = True

End If

Catch ex As Exception

' an error occurred, return null

Finally

' clean up

If Not thumbnail Is Nothing Then thumbnail.Dispose()

If Not (image Is Nothing) Then image.Dispose()

End Try



Return createdThumbnail

End Function



Public Shared Function GetThumbnail(ByVal image As Bitmap, ByVal longestSide As Integer) As Image

Dim thumbnail As Image



Try

' determine scale of the image

Dim scale As Single = CSng(IIf(image.Width > image.Height, _

longestSide / image.Width, longestSide / image.Height))



Dim width As Integer = CInt(image.Width * scale)

Dim height As Integer = CInt(image.Height * scale)



thumbnail = image.GetThumbnailImage(width, height, Nothing, IntPtr.Zero)

Catch ex As Exception

' an error occurred, return null

End Try



Return thumbnail

End Function





Generated using PrettyCode.Encoder

Wednesday, July 19, 2006

Am I working too Hard ???

Well..... now I feel my happy life has come to an end. I have been selected for a new project… and it’s the end of ma life of fun….. Hmmm. what to do? Have to go ahead with our life noh.... And these days I am learning alot of things again. Crystal Report again lol…. Even though I have used Crystal Report b4 now I am learning alot more things on it. Now I feel like I didn’t know anything about it. From next week our Project has to be online and we have to work with live data (Gone mad…. ;) ).I never thought this would happen to me.. lol..

Monday, July 17, 2006

Got stuck with ASP.NET Popup Windows: With Return Values???

I am sure we have written so many Java scrpits to open a popup window and return values to the parent page. In my case I have used this line within the Java script to get values from the popup Window.
document.getElementById('txtDateValue').innerText=returnVal._date

This Code works perfect in normal forms but I got a javascript error when the Parent page uses a master page(wich is in VS2005), I was wondering. Got through.... ;)

Problem is because ASP adds the name of the content placeholder to the front of the text box when generating the html. If you do a right-click, 'view source' on the parent page, scroll down to where the html is for the text box and look at the ID. Thats what we have to specify as the name in the document.getelementbyid command.

For a Example :

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

For this ContentPlaceHolder, Your java script shold be:

document.getElementById('ctl00$ContentPlaceHolder1$txtDateValue').value = returnVal._date;

Thursday, July 13, 2006

Consolas Font Pack for Microsoft Visual Studio 2005

Consolas is one of the new fonts included in Vista. It is cleartype font designed specifically to make code more readable. You can download it from Microsoft Download Center .

Tuesday, July 11, 2006

I'M Back !!!

May and June 2006 were those empty days for my blog.Oh!!! I forgot!, June 2006 is the first anniversary of my blogging.Have to thank my buddy charith who made me start blogging.
Anyway "Today" is a Bigday for me, coz it's my first day @ my new job.I resigned from my previous one last May and had a fantastic time with ma family and my friends.I think now it's back to work......Hope everything will be fine this time. So? Will c :-)

Monday, June 26, 2006

Another step Forward....

I got through Microsoft certified Exam (70-305). "Web Application Development with ASP.Net". All credit goes to the Author (jeff webb with Microsoft Corporation) of the book "MCAD/MCSD self-paced training kit: Developing web Applications with microsoft visual basic.net and microsoft C#.net", my buddy Thusitha who always guided me when I got any doubt and my loving parents.

Monday, May 08, 2006

Live Messenger Beta Has Updated Again

I couldn't sign in into Messenger for one week.Today, when I tried to sign in, it gave me this updating message.

I think they have given a cool UI once again. It's nice. Actually the previous version gave me trouble when trying to sign in. Hope they have fixed that! :) Speed and memory usage is considarably enhanced compared to the previous release. New icons: I'd say "wow!". It's really cool! So lets wait for the new release...... Hope they will add some new emoticons too ;)

Friday, April 21, 2006

New Laws of Software Engineering...

Today I backed-up my old mails. Found a good one while doing so...

New Laws of Software Engineering...
Law 1.
Every Software Engineer continues his state of chatting or forwarding mails unless he is assigned work by external unbalanced manager.

Law 2.
The rate of change in the software is directly proportional to the payment received from client and takes place at the quick rate as when deadline force is applied.

Law 3.
For every Use Case Manifestation there is an equal but opposite Software Implementation.

Bonus :-) Law 4.
Bugs can neither be created nor be removed from software by a developer. It can only be converted from one form to another. The total number of bugs in the software always remains constant.

Tuesday, April 18, 2006

????????????

I couldn't post from about two weeks, wondered why,cant think of a Reason for it.
I was wondering...... ,I started ma career in software development in 2004.(new comer isn't it???? ;) ) but I think as a software Developer we have to have self satisfaction about what we have done and what we have to do isn't it? However, but now I think I'm fed up with ma work. Thinking of moveing away.Anyway i have decided to resign.May be it's ma fault. :( so ?All of you Comfortable with your work and place? I never think about the Name of the company.i am just asking about what you all feel about your work place?So what you all think about it???Write some comments here.It will be of use to me. Thanks everyone!!!!

Tuesday, March 28, 2006

CPS tried Singleton form in vb.net

We all get one object each time a constructor is called. If we call a class' constructor three times, we get three instances of the class. Also even if we don't write a constructor in our class, the VB.NET compiler creates a no-argument. However, if a class does have a constructor, whether it is a no-argument constructor or one that accepts arguments, the VB.NET compiler does not create a new one. Normally, these constructors have a public access modifier because they are meant to be invoked from outside of the class.
But sometimes there are cases where we want to limit the number of instances of a class to one. When we Press win+ R in windows XP ( I am using windows xp) it will display a RUN dialog. But when it loaded if we press Win + R button again and again we will get only one RUN dialog. How can we do this in vb.net? The Singleton pattern can be used for this purpose. This pattern is effective for limiting the maximum number of instances of a class to exactly one.

Imports System
Imports System.Windows.Forms
Imports System.ComponentModel

Public Class SingletonForm : Inherits Form

Private Shared myInstance As SingletonForm


#Region " Windows Form Designer generated code "

Private Sub New()
MyBase.New()
InitializeComponent()
End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase
.Dispose(disposing)
End Sub

Me.Name = "SingletonForm"
Me.Text = " CPS Tried Singleton Form "
Me.Width = 450
Me.Height = 150
End Sub
#End Region


Protected Overrides Sub OnClosing (ByVal e As CancelEventArgs)
e.Cancel = True
Me.Hide()
End Sub

Public Shared Function GetInstance() As SingletonForm
If myInstance Is Nothing Then
myInstance = New SingletonForm
End If
Return myInstance
End Function
End Class



Using Sigleton form


Public Class UsingSingletonform
Inherits System.Windows.Forms.Form

Private Sub New()
MyBase.New()
InitializeComponent()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CPSsingleton As SingletonForm = SingletonForm.GetInstance()
CPSsingleton.Show()
End Sub

Public Shared Sub Main()
Application.Run(New UsingSingletonform)
End Sub
End Class



Saturday, March 25, 2006

Finally I got Atlas again

I read about Atlas project in 2005 july or augest @ news.com.and i was lookng @ Atlas Project for more infomations.But wonder i have missed that.i do not know how(may be i was away from web Last 5 months.Sadly i coudnt come online :( ).Anyhow my buddy Charith helped me to Find it again.@ last i got it again.so like to say visit here for more information. So charith thank you once again.

Friday, March 24, 2006

Are you Interested in ORM tools ?

I think I have mentioned about ORM( object Relational Mappers) in here some time ago.But I got a nice artical about how to Select a good ORM tool. it's name goes as How-To-Select an Object-Relational Mapping Tool for .NET . There are about 15 Tools. I have already used some of them.I loved some of them, like My Generation , NHibernate before.But there are some more.

And I got another Great artical about Data Modeling.it's great. try it guys/gals.

aloha, my blog is going to be a Database Blog .......... I have to stop writing about Databases lol

Wednesday, March 22, 2006

Bloggers Meetup ...

Y'day My buddy charith wanted me to be @ Barefoot.So finally I got there. As a Sri lankan Charith got Late(around 30 mints.) Now don't kick my A**.Charith ,Casper and I hanged around barefoot cafe till Razor came to the picture.After Razor's Arrival we met Indi.So hiiiiiii indi ;) Until Wela came it was boring. We were about to leave isn't it?
I met some people for the first time in ma life.But I have read about them before.It's nice to meet u guys.Lot of open source guys were there.Mahangu, Dilantha, Chamil and many more. and I'm very glad to meet The DOTNET guy, wela. :)

More commentary about the meetup.....

Wela, (with some cool pictures).
Charith, (with stolen pictures from wela)
Razor
Mahangu (The open sorce)
Dilantha (A nice guy. I like his way of talking)

Tuesday, March 21, 2006

Did you Try to Create Reports in SQL Server 2005

I just went through Report Option in SQL server 2005. It looks good, can do a lot of things on it just like crystal report.But we can't compare it. b'coz Crystal Reports only for Reporting isn't it?.So Here is some screens which I did.i think You have to Use Business Intelligence Development Studio which is in SQL server 2005. If you need more information about Business Intelligence and Data Warehousing in SQL Server 2005 just click here



How is it? you can Set Server URL for Report Engine In project properties.Then You can view the Report in Internet Explorer

Wednesday, March 15, 2006

What happened to my Domain name?

I wanted to buy a Domain name CPS.net or .com as my Home page. But it's already taken. So I decided to buy Chaminda.net Last December. But b’coz of some problems I postponed that. Actually I forgot to resolve. I wanted to buy it Today. Gone mad it is not available now. I am sure it was available till January. B’coz I checked about it. So I am warning you all. If u want to buy a domain name do it ASAP. Otherwise it will no longer be available. So do it today.

Monday, March 13, 2006

I don't know whats wrong with me!

I haven’t done anything since last Friday. I didn’t open Sql server or visual studio for the weekend. I do not know what i was doing in the weekends. Didn’t go through a book even. I have to complete thousands of work. What’s wrong with me? Can’t I change my Mind?? :(

Friday, March 10, 2006

Got my new Mobile

i sold my Old Nokia 6260 and was hanging without a mobile the last 2 weeks.b'coz Softlogic had no stock of nokia 6630.finallyI got my new Nokia 6630 Today.It's not da Phone which i was dreaming.i was dreaming about Sony Ericsson W800 or a K750i.but it was tooo expensive :( so i changed ma mind and thought to buy a 6630.but it's great.it has a nice Head set with good sound quality.i think i can use my mobile as a mp3 player.it's great.now i am searching for a mp3 player with a equalizer for my mobile.i have to say it again it's a great mobile which i ever used.

Thursday, March 09, 2006

It's interesting to work with sql Server 2005

I imported Some of my sql server 2000 Databases In to new Sql server 2005.i saw something new in sql TOP Key word.The TOP operator has been around since SQL Server 7.0( i think so.), in the past it only accepted a constant as the number of rows to return or as the percentage of the rows to return. The TOP statement in SQL Server 7.0 and SQL Server 2000 was also limited to SELECT statements. Thanks to improvements in the TOP operator for SQL Server 2005, the TOP statement can now accept variables and subqueries for the number of rows to return or the percentage of the rows to return. The TOP operator has also been enhanced so that it can be used with INSERT, UPDATE, and DELETE statements in addition to the SELECT statement.

DECLARE @intRows INTEGER;
DECLARE @startAfter INTEGER;
SET @intRows = 12 ;
SET @startAfter = 10;
SELECT TOP (@intRows) * FROM HumanResources.Employee
WHERE EmployeeID > @startAfter
ORDER BY EmployeeID;
GO


And we Can set Varible Values programicaly.

We can still use the PERCENT keyword to return a percentage of rows instead of a fixed number of rows. And sql server 2005 we can use it with Top keyword with a variable value.

DECLARE @intPercRows INTEGER
DECLARE @intPage INTEGER
SET @intPercRows = 12
SET @intPage = 10
SELECT TOP (@intPercRows) PERCENT * FROM HumanResources.Employee
WHERE EmployeeID > @intPage
ORDER BY EmployeeID;
GO



In addition to passing an expression, we can also use a subquery to satisfy the TOP statement value requirement.

DECLARE @startAfter INTEGER;
SET @startAfter = 0;
SELECT TOP (SELECT COUNT(*)/11 FROM HumanResources.Employee) *
FROM HumanResources.Employee
WHERE EmployeeID > @startAfter
ORDER BY EmployeeID;
GO

Wednesday, March 08, 2006

First Day in Sql 2005

First time i Enter in to sql 2005.Where is that Enterprise Manager,Query Analyzer and Analysis Manager Short cuts?? They have remove them and introduce a new interface call SQL Server Management Studio.its a new integrated tool that combines the functionality of three tools: Query Analyzer, Enterprise Manager, and Analysis Manager. In addition, it allows us to manage all other components, such as Reporting Services, SQL Server Integration Services (SSIS; formerly known as DTS), Notification Services, and SQL Server Mobile. WOW.......


and it has Template Explorer.we can can lot of Templates for various sql functions from this Template Explorer. So what else we need??? .let me go through and find out ;)

Tuesday, March 07, 2006

working with Sql server 2005

I installed sql server 2005 Work group Edition at my home compuater last december. but Still i could not work on it well.i thot to start it today.yeah it has great new features with a reporting Server. so ?? lets move

Monday, March 06, 2006

Back to blogger.com

It's all Most 5 months from my last blog entry.could not write here i do not know wot happned ? Did some Smart clients project for the company with web service support.hmmmmm it was a great Opportunity to me.i learn lot of things from it.

So ? it's great to back in blogspot. :)