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?? :(