http://blog.sumantdubey.com/blog/post/SQLDataSource-Passing-Null-Parameters.aspx
Tuesday, August 26, 2008
Saturday, May 24, 2008
Here comes Visual Studio 2008 and .NET Framework 3.5 Service Pack 1
Though it is still in beta stage, it won't take long for this feature packed service pack release to come to developers.
Read this post of Scott's to know what's there in the pack.
ASP:Image auto generates - style="border-width:0px;"
Read the post about a fix for this behavior of asp.net here.
Thursday, April 24, 2008
How to use BackgroundWorker component in a WPF Application
My post on 'How to use BackgroundWorker component in a WPF Application' - it's here - http://blog.sumantdubey.com/post/Using-BackgroundWorker-component-in-a-WPF-application.aspx
Friday, March 14, 2008
10000080 - Mobile phone not responding.
This is very specific to Sony Ericsson PDA phones (mine is P1i).
If you encounter any of the following behavior while taking a backup -
- 10000080 - Mobile phone not responding.
- settings cancelled by the device
- Cancelled by device.
- Failed.. etc.
Delete all old backup files and then take a new backup. If you don't want to loose old backups then you should first export them and then delete. Exported backups can be imported back any time.
I kept on struggling for days and then finally decided to Master Reset my phone. Fortunately I came across some threads on the internet where people have faced same problems and while I had tried everything else, only this was the remaining thing. And it works!
Monday, February 25, 2008
ThreadAbortException while using Response.End
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 :
Friday, February 8, 2008
View and Generate XPS
If you are not using Windows Vista or MS Office 2007 on non Vista systems, you may add XPS support by downloading XPS Viewer and Writer from here - http://www.microsoft.com/whdc/xps/viewxps.mspx
Thursday, January 31, 2008
Fill a string with repeating character (.NET)
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!