Search

May 29, 2007

Calculate period of time with .NET

Hi all,

We all are facing problem in calculating difference between date.

I have one good delicious, have a look at Calculate period of time with .NET.

May 22, 2007

Global.asax problem in Webservice...

hello all,

I came accrosse one situation where i need to execute code on Application Start, but due to some problem webservice was not executing code written in Global.asax file.

After googling i got good link as soluction, The missing part was code file

Have a look at delicious Problem with Global.asax file in VS 2005.

May 19, 2007

ANTS Profiler - .NET code and memory profiler

ANTS Profiler identifies performance bottlenecks in applications written in any of the languages available on the .NET Framework. To profile your application, use your application as normal within ANTS Profiler. During the performance profiling, ANTS Profiler records the frequency and time it takes for each line of code to be executed, as you are using your application. Detailed results will then reveal the slowest lines of code and methods, allowing you to quickly identify performance bottlenecks and optimize your .NET application accordingly.

Have a look at delicios.

May 11, 2007

Implementing the Singleton Pattern in C#

Hi

I found good article on Singlelton Pattern, what is singleton, how to implement etc ....

Have a look at delicios.

May 10, 2007

HTTP Response Codes

Hi all,

In the web world we are getting lots of HTTP error, i have delicios which has all the response codes with its description.

May 5, 2007

A Complete URL Rewriting Solution for ASP.NET 2.0

Hi All,

I found one interesting article, which is simply best for URL Rewriting.

I have delicious on URL Rewriting

May 3, 2007

Avoid dynamic query at some extend [SQL 2k]


select * from [northwind].[dbo].[orders]
This will probably returns 830 rows [thats default],

Now what if I want top 10 rows or to 20 rows may be more, I will create dynamic query like...
declare @statement varchar(100)
declare @iTop int
set @iTop=3
set @statement ='select top ' + convert(varchar(2),@iTop) + ' * from [northwind].[dbo].[orders]'
EXEC (@statement)
We can do as follows which don't requrie creating dynamic query.

declare @iTop int
set @iTop=3
set rowcount @iTop
select * from [northwind].[dbo].[orders]
This will display top 3 records!!

Now set rowcount to 0 to get all the records

set rowcount 0

Apr 4, 2007

Exception Handling in SQL2k5

Hi

For handling exception just need to write 4 additional statements!


BEGIN TRY
print convert(int, 'hi')
END TRY
BEGIN CATCH
print @@ERROR
print 'ERROR'
END CATCH

OUTPUT:
245
ERROR

It's simple!!

Mar 20, 2007

Playing with location of window in javascript

I found some properties and method which is really usefull while working with window location

· Properties

window.location.hashthe part of the URL that follows the # symbol.
window.location.hostthe host name and port number
window.location.hostnamethe host name (without the port number).
window.location.hrefThe entire URL
window.location.pathnameThe path (relative to the host).
window.location.portThe port number of the URL
window.location.protocolThe protocol of the URL
window.location.searchthe part of the URL that that follows the ? symbol


· Methods
assign(url)Load the document at the provided URL.
reload(forceget)Reload the document from the current URL. forceget is a boolean, which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified, the browser may reload the page from its cache.
replace(url)Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.
toString()
Returns the string representation of the Location object's URL. See the JavaScript
reference for details.


I have delicious on JavaScript

Mar 2, 2007

Overload property in .NET

Hello Friends,

I have new information to .NET programmers.
We can create or rather I say we can overload the property in VB.NET and C#
But there is a very vast difference in both languages

· VB.NET

Private ReadOnly Property MA() As String
Get
...
End Get
End Property

Private ReadOnly Property MA(ByVal movAvg As String) As String
Get
...
End Get
End Property


Ohh this is working like function overloading! But still its property!

· C#

public string Author
{
set {_author = value;}
get {return _author;}
}

public AuthorEntity Author
{
set {_authorEntity = value;}
get {return _authorEntity;}
}

You will be attempting to overload a function which differs only by return type, and it won't compile. this is why properties can't be overloaded in the way you want - because they are converted to get functions which would only differ by return type.

You can see the difference in both language. And its working!!!