Managing Connection String for LINQ

by Sumant 19. October 2010 15:16
Managing Connection String for LINQ: This is a very common requirement, you build an application, test it and publish it and in all of the three stages your connection string changes while your dbml file still refers to the default one in your application settings file. [More]
Share   

Tags: , ,

.NET | ASP.NET | LINQ

IIS 7 migration issue: Session state can only be used when enableSessionState is set to true …

by Sumant 19. October 2010 01:31
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration. [More]
Share   

Tags: , ,

.NET | ASP.NET | Web Development

CS1529: A using clause must precede all other namespace elements except extern alias declarations

by Sumant 20. December 2009 12:56
CS1529: A using clause must precede all other namespace elements except extern alias declarations - BlogEngine.NET [More]
Share   

Tags: , ,

.NET | ASP.NET | BlogEngine.NET

PageMethods - Nightmare!

by Sumant 27. August 2008 08:52
PageMethods - Missing or Not Behaving ..? [More]
Share   

Tags: ,

.NET | AJAX | ASP.NET | Web Development

SQLDataSource : Passing Null Parameters

by Sumant 26. August 2008 13:29
How to pass NULL values to parameters while using SQLDataSource and Stored Procedures. [More]
Share   

Tags:

.NET | ASP.NET | Web Development

Here comes Visual Studio 2008 and .NET Framework 3.5 Service Pack 1

by Sumant 16. May 2008 13:03
Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta released [More]
Share   

Tags: ,

.NET | AJAX | ASP.NET | Visual Studio 2008

ASP:Image auto generates - style="border-width:0px;"

by Sumant 16. May 2008 12:17
A resolution for making asp-image border visible using css. [More]
Share   

Tags:

.NET | ASP.NET | Web Development

Using BackgroundWorker component in a WPF application

by Sumant 24. April 2008 02:57
check out how to use BackgroundWorker component in a WPF Application. [More]
Share   

Tags: ,

.NET | WPF

ThreadAbortException while using Response.End

by Sumant 26. February 2008 01:05
Whenever there is a call to Response.End() method in your ASP.NET code, and there are lines of code following this call (which we expect not to be executed), then in such a case a System.Threading.ThreadAbortException is thrown which can be caught using a try-catch block. This exception can also be thrown while calling Response.Redirect or Server.Transfer methods as they also call Response.End internally. The resolution for this issue is - Response.End : use HttpContext.Current.ApplicationInstance.CompleteRequest instead of Response.End. Response.Redirect : use the overload Response.Redirect(String url, bool endResponse) where second parameter indicates if Response.End should be called or not. Server.Transfer : use Server.Execute While the requirement can be different and you may not want to just replace Server.Transfer with Server.Execute, handling the exception is a better solution in such a case. Also, calling ApplicationInstance.CompleteRequest or Response.Redirect with endResponse set to false, will still go through the complete page and application life cycle which may be expensive. In this case as well, when you may want the execution to be aborted immediately, instead of workarounding this issue as mentioned above, handle the ThreadAbortException and let all threads be aborted immediately. This issue is documented in Microsoft's KB at http://support.microsoft.com/kb/312629/EN-US/ . It states, it applies to ASP.NET 1.0 and 1.1, but it applies to 2.0 as well. Related Articles : PRB: System.Threading.ThreadAbortException Error Message When You Use Server.Transfer in HTTPHandler in an ASP.NET Application Indepth analysis of this issue and resolution by John S. Reid
Share   

Tags: ,

ASP.NET | Web Development | .NET

Fill a string with repeating character (.NET)

by Sumant 31. January 2008 06:16
If you want to fill a string with a character n times (e.g. 'aaaaaa') then you just have to instantiate the string and pass the character and number of times, that you want it to repeat, to the constructor. Example: C# : String S = new String ('a',6); VB.NET : Dim S as String = new String ('a',6) Thats it!
Share   

Tags:

.NET

© 2008 Sumant Dubey

About this blog

Absolutely technical! The posts are about concepts, tricks, articles and links on technical subjects / problems which are not very obvious to understand / resolve. Purpose is to have this as the first-aid in the time of need.

RecentComments

Disclaimer

The opinions expressed on this website are my own personal opinions and do not represent my employer's view in anyway.