Geeks With Blogs

News Awarded Microsoft MVP C#.NET - 2007, 2008 and 2009


I am born in Bangladesh and currently live in Melbourne, Australia. I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net)and born in Bangladesh.
I am founder and Chief Executive Officer of
Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. Co-founder and core developer of Pageflakes www.pageflakes.com.
Simplexhub, is on its mission to build a smart virtual community in Bangladesh and recently launched beta realestatebazaar.com.bd an ASP.NET MVC application written in C#.NET.


Some of My Articles
Flexible and Plugin based .Net Application..
Mass Emailing Functionality with C#, .NET 2.0, and Microsoft® SQL Server 2005 Service Broker'
Write your own Code Generator or Template Engine in .NET

Shahed Khan blog November 2006 Entries
Consider using XmlTextReader over XmlDocument

Do you know XmlDocument or XPathDocument creates an in memory representation of the entire XML document. And this typically consume memory equivalent to three or four times of the size of the XML document on disk.

On the other hand XmlTextReader, loads only 4KB (kilobyte) buffer into memory and give better performance and scalability.

Posted On Wednesday, November 29, 2006 11:01 PM

SmartCodeGenerator (ASP.NET 2.0) CTP1 uploaded at Codeplex
The CTP1 of SmartCodeGenerator can be also downloaded from CodePlex.http://www.codeple... And the homepage for this project at Codeplex ishttp://www.codeplex.com/s... am also in the process of building the community site.http://community.smart... (very early stage) ......

Posted On Wednesday, November 29, 2006 5:55 AM

Some quick tips for Asp.Net Application Performance Tuning
Sometimes when you want to quickly tune asp.net application the following points can be checked (not in any particular order) as it requires minimal code changes to the application. 1. Analyze Database while running the application, via sql profiler. Identify which stored procedures are called and whether the database tables are properly indexed. And queries not performing Full table scan for any case. 2. Recommended Threading Settings for Reducing Contention Configuration setting Default value (.NET ......

Posted On Tuesday, November 28, 2006 6:37 AM

SmartCodeGenerator (Asp.Net) at CodePlex
Hi Guys I have started moving SmartCodeGenerator to CodePlexhttp://www.codeplex... For the time being please stick to the old links:Tutorials : http://www.smartcodegenerat... GotDotnet Link: http://www.gotdotnet.com/co... Myblog: http://www.geekswithblogs.n... Founder SmartCodeGeneratorShahed Khan"Code Generation has never been this easy" ......

Posted On Monday, November 27, 2006 11:16 PM

Handy Regex expression to validate/format string
Found these handy collection of regex expressions in this site:http://rgagnon.com/jsd... I did not test all of them though.... Use regular expressions to validate/format a stringThis is an impressive collection (that I found somehere on the Net) of various functions to validate or format string in Javascript. The code is very compact. /**************************... FILE: RegExpValidate.js DESCRIPTION: This file contains a library ......

Posted On Monday, November 27, 2006 4:22 AM

SmartCodeGenerator (asp.net2.0) All 4 Examples/Tutorials at one place.
All of the 4 Examples those will familiarize you with SmartCodeGenerator are compiled together and uploaded herehttp://www.smartcodegen... And please download the SmartCodeGenerator CommunityDrop1 from Gotdotnet ......

Posted On Saturday, November 25, 2006 8:33 PM

Example 4: SmartCodeGenerator (asp.net 2.0) Generating Class from SqlServer TableSchema
Download the CommunityDrop1 from here.Example 4 Generating Class from SqlServer TableSchema Step1 Opening Existing Template Open Example4 from Example_Projects folder, as a website project in Visual Studio 2005.Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Put your connection string in the connectionstring field and Click Scan Button. If the connectionstring is ok and this can connect to the database it will load ......

Posted On Saturday, November 25, 2006 10:16 AM

Example 3: SmartCodeGenerator (asp.net 2.0) Writing your first template
Example 3 Writing your First Template Objective We will write a template which will take two properties classname and propertyname and generate code like this based on the customized values entered for the properties.public class TestClass { public TestClass() { //Add constructor here } private string testproperty public string TestProperty { get { return testproperty; } set { testproperty = value; } } } Step1. Installing VS2005 Project and Item Template for SmartCodeGenerator. Make sure you copied ......

Posted On Saturday, November 25, 2006 10:12 AM

Example2: SmartCodeGenerator (asp.net 2.0)and the Profile Object
Example2: Generating Code from existing project/template. And getting familiar with the Asp.Net Profile object. Step1 Opening Existing Template, Launching and Generating Code. Open Example2 from Example_Projects folder, as a website project in Visual Studio 2005. Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Notice the property1 and the textbox to enter value. The properties lets you customize the generated code. ......

Posted On Saturday, November 25, 2006 10:09 AM

Example1: SmartCodeGenerator Familiarization
Example1 Makes you familiar with SmartCodeGenerator.Generating code from existing project/template. Step1 Opening Existing Template Open Example1 from Example_Projects folder, as a website project in Visual Studio 2005.Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Notice the property1 and the textbox to enter value. The properties lets you customize the generated code. Here we are collecting value for property1 and ......

Posted On Saturday, November 25, 2006 10:03 AM

SmartCodeGenerator (Asp.Net2.0) Released at GotDotNet
I am very excited to share with you that I have finally released the CommunityDrop1 for SmartCodeGenerator at GotDotnet. SmartCodeGenerator is an Asp.Net2.0 website application and is a full fledged template based code generator that allows you to generate code for any text language. Templates are written in Visual Studio as asp.net UserControls. The code generation can be dynamically customised by using properties. SmartCodeGenerator Framework reads the asp.net Profile Object specified in web.config ......

Posted On Saturday, November 25, 2006 9:22 AM

Asp.Net Performance: Use explicit cast instead of using Eval
I have come through lots of examples in the web using DataBinder.Eval but if we go and see whats happening under the hood, we will find Eval uses reflection to evaluate argument passed. <ItemTemplate><div... DataBinder.Eval(Container.D... %></div></ItemT... But explicit casting can reduce the cost of reflection. Imagine if there is 30 rows and each row has 6 Eval calls. So there will be calls to Eval 180 times. And we should take this pretty seriously. ......

Posted On Thursday, November 23, 2006 9:02 PM

Asp.Net Tools for Developers
Fiddler HTTP DebuggerHTTP debugging proxy Lutz Roeder's .NET Reflector.NET assembly browser, explorer, analyser and decompiler FxCop.NET best-practice code analyser C# Snippet CompilerLightweight C# code snippet compiler Sysinternals DebugViewMonitors debug output on a local or remote computer WinMergeVisual text file differencing and merging tool GhostDocVisual Studio add-in that automatically generates XML documentation CopySourceAsHtmlVisual Studio add-in that copies syntax-highlighted code to ......

Posted On Thursday, November 23, 2006 4:35 AM

Programmatically accessing Tracing info in Asp.Net 2.0
For enabling Tracing we normally Tweak the config file right.... <configuration><sy... enabled="true" writeToDiagnosticsTrace="true" /></system.web><... But in asp.net 2.0 you can do a bit more... void Page_Load (object sender, EventArgs e){ Trace.TraceFinished += new TraceContextEventHandler (TraceHasFinished);} void TraceHasFinished (object sender, TraceContextEventArgs e) { foreach (TraceContextRecord traceContextRecord in e.TraceRecords) { ......

Posted On Tuesday, November 21, 2006 5:22 AM

Asynchronous Calls in asp.net2.0
.Net Framework 2.0 makes life so easy with asynchronous calls from pages. I remember in asp.net1.x we had to do so much to achieve the same behaviour, but we are lucky that in asp.net2.0 its very easy. Again there are more than one ways to implement asynchronous calls in asp.net2.0 and you may be asking which pattern to use. The first way is to use the AddOnPreRenderCompleteAsync... ( new BeginEventHandler(BeginAsyn... new EndEventHandler (EndAsyncMethod) );The second ......

Posted On Monday, November 20, 2006 1:38 AM

Using Reflection to Get and Set values of Properties
The assembly that is generated for .Net Framework has metadata that describes the structure of the assembly and its classes. By using reflection we can investigate the structure of classes and the data that assembly holds dynamically at runtime. Couple of days back in this project that I am working I had to dynamically get/set values from/to properties of object. The following code will give you a flavor of what I did. To Get value=============== foreach (PropertyInfo info in myObject.GetType().GetPrope... ......

Posted On Sunday, November 19, 2006 12:29 PM

Visual Studio 2005 File > Export Template
Custom templates are sometimes very handy. For example if your pages are inherited from a custom base page. Normally you would have to tweak your pages to fit your framework. Sometimes its even boaring to go and change the new pages added to the project again and again. Say your framework require all pages to inherit from <YourProject.BaseClassNa... Then you have to change the codebehind of the new pages that you add to your project to something like this public partial class _Default1 : YourProject.BaseClassName ......

Posted On Sunday, November 19, 2006 11:57 AM

Cache Invalidation for Dynamic pages in Asp.net 2.0
Asp.net 2.0 supports database cache dependencies. So changes in the Tables data can be notified and cache can expire. This is a very handy feature. Here is how we can do this <@ outputcache duration= "7200" varybyparam="CustomerID" sqldependency="DatabaseName... %> this means the cached page expires in 2 hours but also depends on database table. Any changes on the database table data will also invalidate the cache. Borrowed the following code from this link: Link to Improved Caching ......

Posted On Thursday, November 16, 2006 6:24 AM

Batch Compilation Asp.Net
We are aware that the complition process of Asp.Net 1.x Web page has two phases. 1. Code Behind files and other supporting classes compiled into an assembly.2. And Individual ASPX files are compiled at runtime in to temporary assemblies. This happens during the page request has been performed.So firstime when the user requests a page its slow. I have seen suggested approach like writing a precompile.aspx page which goes and fires requests [ (HttpWebResponse)myHttpWebR... ] to individual ......

Posted On Thursday, November 16, 2006 12:10 AM

Deleting duplicate rows when there is no primary key
Deleting duplicate rows when there is no primary key ProblemEvery once in awhile a table gets created without a primary key and duplicate records get entered. The problem gets even worse when you have two identical rows in the table and there is no way to distinguish between the two rows. So how do you delete the duplicate record? SolutionOne option that SQL Server gives you is the ability to set ROWCOUNT which limits the numbers of records affected by a command. The default value is 0 which means ......

Posted On Sunday, November 12, 2006 10:21 PM

.Net Role checks using programmatic, declarative and imperative techniques
.Net Role Checking Examples===================... following code fragments show some example role checks using programmatic,declarative, and imperative techniques. 1. Authorizing Bob to perform an operation:Note: Although you can authorize individual users, you should generally authorize based onrole membership which allows you to authorize sets of users who share the same privilegeswithin your application._ Direct user name checkGenericIdentity userIdentity = new GenericIdentity("Bob");if ......

Posted On Sunday, November 5, 2006 11:11 PM

Asp.Net Working with Certificates for secure communication

source: http://www.aspnetpro.com/newsletterarticle/2006/10/asp200610mb_l/asp200610mb_l.asp

Working with Certificates

Create, Access, and Employ Certificates in Your Applications

Posted On Friday, November 3, 2006 4:33 AM

Ajax Toolkit Live Demo
If you havevn't seen and played with them yet... http://ajax.asp.net/ajaxtoo... can see all the following control extenders live in action:Accordion AlwaysVisibleControl Animation CascadingDropDown CollapsiblePanel ConfirmButton DragPanel DropDown (New!) DropShadow DynamicPopulate FilteredTextBox HoverMenu ModalPopup MutuallyExclusiveChe... (New!) NoBot NumericUpDown PagingBulletedList PasswordStrength PopupControl Rating ReorderList ResizableControl RoundedCorners Slider TextBoxWatermark ToggleButton ......

Posted On Friday, November 3, 2006 12:14 AM

Copyright © Shahed Khan | Powered by: GeeksWithBlogs.net | Join free