Friday, August 08, 2008

I becomes We

After a long travel I got my sweetheart smitha on Apr 11 th 2008. Wow felt like entered into a new world with her. From that day my heart was full of her nothing but full of happiness. Here I want to explain her she is good hearted by birth. She does what i like and wish. Then let me continue my journey.. weekly twice will meet in a big shopping mall, and shared many things... :-). To explore our relationship we got married on jun 23 2008. I want to say thanks for giving me a wonder full heart to me. We are living in same fresh till now... and for ever.

Friday, February 16, 2007

Asynchoronous Data Fetching...

We would have faced Session Timeout Issue and some runtime error if we have huge number of records to be displayed in web. To eliminate this we can go for a mixture of Asynchoronous call and caching. I have explained in macro level and you can tune based upon your requirements.
Please follow these steps...
/*Declare a Delegate*/
private delegate void ExampleDelegate();
/*Map the delegate to a function which is going to be a asynchronous*/
ExampleDelegate dlgInstance = new ExampleDelegate(GetSmartsData);
/*Invoke the call back function*/
dlgInstance.BeginInvoke(new AsyncCallback(DrawGrid),null);
/*Actual Async enabled Function*/
private void GetSmartsData() { Populate the date from the DB asynchronously.Let us assume the data in dataset object ds.}
/*Call back function with caching */
private void DrawGrid(IAsyncResult results) {
Cache.Insert("FirstGrid",ds,null,System.DateTime.Now.AddMinutes(15),new System.TimeSpan(0));

It is working fine in my application.Please let me know if any issues. Happy coding.

Tuesday, July 11, 2006

Intellisense for SQL Server

Hi All,

Sharing with you guys a free and cool add in for your sql query analyzer of SQL Prompt.You can download this cool tool from Reg-gate site, Which is a free download till 1st-September. Hurry guys..

Let it make our jobs easier....

Wednesday, July 05, 2006

How to make a PDF files to speak ?!!@

Hey you know onething one of my friend is too lazy to read, need is the mother of invention :-). He gave a wonderful feature that is available in Acrobat Reader. That will read out of the content very clearly. The amazing thing page scrolls automatically when it reads out. Then the question of how to do this ?
  • Open any PDF file which as content in readable format.
  • Press Ctrl+Shift+B

Thats it!!! You can just listen the Acrobat reads for you.... Hope you enjoy this :-) Now I know how my lazy friend knows lot of things without reading.

Monday, July 03, 2006

Basics of Microsoft Building Blocks

Small piece of information which I want to share, regarding Microsoft Application Building blocks.

Like every developer and architect out there, you want your solutions to be efficient, robust, elegant, and cost effective. But as you well know, attaining these goals isn't always easy. Microsoft has begun the process of making your life easier by publishing information on patterns and practices, some of which you’ll find enlightening and useful.
I address each of the blocks to help you get a feel for how it can be used.
  1. Data Access Application Block - Implements a data access helper component, SqlHelper, which helps execute statements against SQL Server 7.0 and higher by exposing a set of static methods and reduces the amount of data access code you have to write
  2. Exception Management Application Block - Provides a simple and flexible mechanism for publishing exception information through an ExceptionManager class. Also supports filtering and creating your own exception publishers to publish data to sources other than files and event logs using text and XML.
  3. Aggregation Application Block - A component that to collect information from various sources for the application. The application then makes requests to the aggregate component and it returns a single XML document of the collected data.
  4. Asynchronous Invocation Application Block - A component that dispatches requests on background threads and then notifies the application when complete.
  5. Caching Application Block - Allows applications to make requests of a CacheManager object that either returns the data. Allows items to be expired from cache and cached data to be stored in a variety of format including SQL Server, File etc.
  6. Configuration Management Application Block - A component that abstracts the location of configuration information used in an application and adds features including encryption, caching.
  7. Updater Application Block - A component that can be used to download new versions of applications to client machines.Provides optional support for custom downloading and verification components in client machines.
  8. User Interface Process Application Block - A component that allow you to separate the logic and state of a user process from the UI needed to collect data and navigate.

I am going to start exploring on each of these application blocks in detail in my upcoming blogs. Because I have to explore on these blocks day by day... :-)

Sunday, July 02, 2006

Loading image from embedded resource

Guys to add an image as an embedded resource in a Windows Forms application,Please traverse these steps.

  1. add the image file to the project with Project Add Existing Item.
  2. Then select the file in the Solution Explorer, go to the Properties Window, and set its Build Action property to Embedded Resource. At this point the file will be embedded within your compiled file, when you build the project.
  3. The following routine shows how to load the embedded image in a PictureBox, at runtime:

    //load the bitmap...
    string bmpName = "MyNameSpace.sync.bmp";
    System.IO.Stream strm = null;
    strm = this.GetType().Assembly.GetManifestResourceStream(bmpName);
    string[] s = this.GetType().Assembly.GetManifestResourceNames();
    pictureBox1.Image = new Bitmap(strm);
    catch(Exception ex)
    if(strm != null)

Note that we have use the project's default namespace as a prefix while reading image from Resource.

Please go thru this Extensive Sample

Writing in Web.config file dynamically...

Web.config allows the developers to change the configuration of the application without having to build the application. Its not a good idea to write to the configuration file dynamically as it will restart the application. But sometimes we need the feature to dynamically write to the config file. This can be the case when you allow the users to personalize the connection string. In this article we will see how we can dynamically write the connection string to the Web.config file.
What are we going to write?
Since, we are changing the connection string dynamically we will need to write the key as well as the database name to the configuration file.
C# Code:
We will need to include the namespace System.xml. All we are doing is setting the tag in web.config file.
private void SetConfigSettings()
string path = Server.MapPath("Web.config");
string newConnectionString = @"Server=local;Database="+txtDatabaseName.Text+";Trusted_Connection=true";
XmlDocument xDoc = new XmlDocument();
XmlNodeList nodeList = xDoc.GetElementsByTagName("appSettings");
XmlNodeList nodeAppSettings = nodeList[0].ChildNodes;
XmlAttributeCollection xmlAttCollection = nodeAppSettings[0].Attributes;
xmlAttCollection[0].InnerXml = txtKey.Text; // for key attribute
xmlAttCollection[1].InnerXml = newConnectionString; // for value attribute
xDoc.Save(path); // saves the web.config file
Although it's not a good idea to write to the configuration file dynamically but sometimes depending on the situation we might have to use that approach.

How to comment out ASP.NET Tags?

If we want to comment the asp.net server controls we can use <%-- and --%>pair.

Happy coding... It is getting late I am moving to watch Brazil Match :-)

Saturday, July 01, 2006

Creating Setup and Deployment Projects in VS.NET

Section 1: Introduction
This step-by-step tutorial guides you how to create a setup and deployment project using Visual Studio .NET to build a setup of your applications. Before creating Setup we should have answer for these questions
1. Why?
If we automate the installation instead of manual installation I can assure that 30-40% of post-installation issues can be reduced.

2. Deployment Plans?
There are many topics that have to be thought about before releasing a plan for process of installation. Some of the critical questions to these issues are as follows:Q:

  • a) What do you want to deploy? Is it a Web application files setup, Client Desktop Setup or a Database installation?
  • b) What are the pre-installation Harware configuration i.e processor settings,RAM, disk space etc; Software packages i.e MS Office, SQL Server Enterprise edition, etc that are mandatory for you to setup?
  • c) Which are the physical paths for your custom files, system files, Database (.dat, mdf etc), configuration files, read-write files? This is critical today since for us to be Windows 2003 compliant there are certain rules that have to be followed in this regard.Q:
  • d) What do you want to configure post-installation? These may include things like configuring database connection string in your Web.config files;

Section 2:Project Types

There are five types of setup and deployment projects in VS.NET, but three are of significant importance that are “SetUp Project”, “Web Setup Project” and “Merge Module Project”.

  • Setup Project - Generic type of project that could be used for all type of applications including web based application.
  • Web SetUp Project - Name suggests the type; this project type helps in creating virtual directories for web based applications during installation.
  • Merge Module Project - When you want to install some additional third party software like MSDE along with your application then you can use this type of project. Use a *.msm extension based merge module installation of MSDE along with your own and create a setup.

Get Started

1) Select a SetUp Project type as shown in Display 1.

2) The default File System editor will appear in the window as shown in Display 2

3) One can add special folders here into which they intend to add files. Just right click on the editor to view the special folder types available. These are the folders into which you can drag and drop an entire folder structure with files.

4) Click on Registry editor and navigate to that editor (Display 3). One can configure registry settings here like “Manufacturer’s name”, “Version No”, etc.

5) There is also Launch Conditions editor available. This is of greatest use since one can pre-validate for certain rules even before installation.

6) File types editor is used to associate a default command action, File description , icon and extension for your custom files. There are many occasions we create new file-types with extensions like “.rmt” or “.cpg” etc.

7) User Interface editor is provided in VS.Net by default with certain additional dialogs as per the requirements (refer display 9). Add for e.g. Textboxes (A) option that provides you with 4 textbox with edit value, label and property.This is the most important editor since this is the UI that interfaces between the user and your MSI setup. The values captured from here are used throughout the installer like in Custom actions.

8) Custom actions editor is where one adds some custom built *.exe, *.bat, *.wsh and other script files. As an example I have added a new C# windows application project as in Display 11. The following code in display that has a “Messagebox.Show” for a command line argument received. This could very well be any other functionality instead of Messsagebox.

9) Installer setup is now complete. Build the project and try to install.

Though I have not been able to discuss complete technical features of VS.NET to create MSI, the features discussed in this article with some individual reading are very much sufficient to create a professional MSI installer.Happy Programming!

Check Deployment Properties, Custom Actions in MSDN.

Quandary IE WebControls

Anybody is using Microsoft Web UI Controls still !!! then I think you should come across with this problem "Access Denied : Microsoft.Web.UI.WebControls". I was facing the same error in my application. Then as usaul I started with bottemless googling and got some Elucidation for it. Try any one of these or all steps Which I have listed down :)

  • Check whether Indexing service is running if it is then stop it.
  • Reboot the machine once.
  • Remove the ASP.NET Temporary Files from Windows folder.
  • Deferencing the controls.
  • Copy all your dlls to bin folder and add reference from it.
  • Remove Windows Indentity Impersonate from your app.config file or in your code.
  • Destory the ASP.NET Worker Process.

Hope these steps makes your life somewhat easy :)