Welcome to Vishwa's blog - Technology, Spirituality and More...

Catch Your Application Errors

You must be thinking that your web site is working great and generating no errors. But have you ever tried catching errors on Application_Error event in Global.asax, it catches all unhandled errors. Try applying the following code, and you will be amazed to see that your site is generating some errors which you were not even aware of. The following method will dump all the erros into a XML file which will be create on montly basis. Initially I was sending these errors to my email, but it is not easy to analyze all the data at once. XML file can be imported in Excel easily and you can fix the code which is generating more errors. [More]

Create XML Data file with Element vs. Attribute Format

You can choose to create a XML file in which detail records are represented as Elements or Attributes only. It is wiser to use the best use of both, more use of attribute reduces the size of xml file and increases the speed over wire. Representation of data in Elements only XML file becomes heavier in file size thus slower the transmission. The only benefit is when you open this file in browser it is relatively easily to read. Following are an example for creating a file with same information in two different ways. [More]

Certificate Error: Navigation Blocked

There are some situations especially in development or QA environment when you would to like ignore the SSL certificate. Generally this warning occurs when SSL certificate is either assigned to a different domain name, IP Address or self signed. You will most likely see the one of following error or warning messages when information is posted manually through Internet Explorer or FireFox browser. [More]

Using XMLWriter and XMLReader

This is a simple example for demonstrating how to use XMLReader or XMLWriter for reading or writing a XML file or XML String. I am using a Customer Entity which was created in previous examples. [More]

Data Transfer Objects (DTO) - Business Layer

I will be consuming the data which was returned by Data Access Layer in the form of XML, Dataset, DataTable, ArrayList and Custom (Data Transfer) Objects to populating my Business Object, which will be finally consumed by a User Interface and most likely a web page. In this example, I will use only one class, which will perform the CRUD operation on Customer Object by invoking method of Data Access Layer. Since I have added methods in data access layer to return Customer(s) data in form on XML, Dataset, DataTable, ArrayList and Custom (Data Transfer) Object. No matter in which form data is returned from data access layer, the business object will read that object and consume the data to make it ready for business object caller. [More]

Data Transfer Objects (DTO) - Data Access Layer

When you separate your business layer from data access layer in two different assembly, you come across a situation as which data transfer method will best fit you. In this example, I went through various Data Transfer Objects(DTO) which are currently available in .NET such as XML, DataSet, DataTable, ArrayList and Custom Data Transfer Object . One DTO generally maps to one Business Object. Each option has its pros and cons, so depending on project one should choose as what best fits the need. In the following code I have tried to use all the four possibilities. [More]

I Salute You Missile Man

On the eve of 60th Independence Day of India, I would like to post a speech of our outgoing President Dr. Abdul Kalam. He is one of the great sons of India. One may respect him because he was President of India, but I have a deep respect and admiration for him because of his genuine contribution in growth of our nation. He is a true Bharat Ratna (Jewel of India). I was privileged to see and listen to him in person on Feb 19, 2006 in Bangalore, India. His speech touches the heart. I would like to share one of them today. [More]

Freeze Column in GridView

The following example will demonstrate as how to freeze or fix one or more column in a GridView. I have used stylesheet to achieve this result. At present this solution only works in IE 7.0. The data source is a xml file containing product sales result. [More]

Find Permission on all objects

I came across a situation where I had to find all the stored procedures or user defined functions that do not have “execute” permission under a particular user. Here is a simple SQL Statement one which can be used under SQL Server 2005 to find those objects. [More]

Speed Test: Generic List vs. ArrayList

It is very important to evaluate the most efficient way of passing data between layers. Many people recommend using ArrayList, some Generic List. But which one is the most efficient way to use? I thought to perform a speed test between Generic List and ArrayList in VS2005. Some people blindly accept that ArrayList is the fastest way. But is it true? Let’s have a real test by reading and writing hundred thousand records using each type and see the outcome. Knowing the fact that Collection, Data Table and XML is slower than these two but how much? Let’s put them to test too and compare the result. [More]