NEWS

Wednesday, July 21, 2010

Using C# and AB.Net pages in same asp.net project

You can achieve this easily in the website project


see the below link:

http://timheuer.com/blog/archive/2007/02/28/14002.aspx

But it is not that easy in the web application project.

refer to the links below:

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8c8fe4fc-3204-4a1d-b6c3-41e572f88884

http://stackoverflow.com/questions/1547308/asp-net-web-application-with-c-vb-net-both-in-codebehind

But I found an alternate way to do this with the idea from this link

http://articles.sitepoint.com/article/asp-dot-net-basics

I came across challenge of having the Master page, user controls and business layer all in C#..

but have to add VB page along with the C# pages.

Thursday, July 8, 2010

How to find Last Date and First Date of Current Month in T-SQL Code?

declare @startDate datetime


declare @EndDate datetime

declare @currentDate datetime

set @currentDate = getdate()



set @startDate = CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@currentDate)-1),@currentDate),101) -- 1st day of current month

set @EndDate = CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,@currentDate))),DATEADD(mm,1,@currentDate)),101) -- last day of current month



declare @startDateTwoYearsBack datetime

set @startDateTwoYearsBack = DATEADD(yy,-2,@startDate) -- for getting date which is 2 years back.



select @startDate, @EndDate,@startDateTwoYearsBack

Laws Newton Forgot to Mention

Interesting and very true....Most of us would have experienced atleast


some of these!!!



Laws Newton Forgot to Mention:





LAW OF QUEUE: If you change queues, the one you have left will start to move

faster than the one you are in now.



LAW OF TELEPHONE: When you dial a wrong number, you never get an engaged

one.



LAW OF MECHANICAL REPAIR: After your hands become coated with grease, your

nose will begin to itch.



LAW OF THE WORKSHOP: Any tool, when dropped, will roll to the least

accessible corner.



LAW OF THE ALIBI: If you tell the boss you were late for work because you

had a flat tyre, the next morning you will have a flat tyre.



BATH THEOREM: When the body is immersed in water, the telephone rings.



LAW OF ENCOUNTERS: The probability of meeting someone you know increases

when you are with someone you don't want to be seen with.



LAW OF THE RESULT: When you try to prove to someone that a machine won't

work, it will!



LAW OF BIOMECHANICS: The severity of the itch is inversely proportional to

the reach



LAW OF COFFEE: As soon as you sit down for a cup of hot coffee, your boss

will ask you to do something which will last until the coffee is cold.