Why C# or VB.net Generics perform better than Collections – a case study with example

Generics are the most powerful feature of .NET 2.0. Generics not only allow us to define type-safe data structures but also gives us a significant performance boost and higher quality code. Collections means we are talking about System.Collections and Generics means we are talking about System.Collections.Generic. The data structures in System.Collections are all Object-based, and thus inheriting the two problems: performance and lack of type safety. Hence .NET 2.0 introduces a set of generic collections under System.Collections.Generic namespace to overcome these two problems mainly. For example, generic List<T> data structure is equivalent to the non-generic ArrayList. Here in this article we are going to analysis the performance between Generics(List) and Collections(ArrayList). After doing the example hope you will get a lot of confidence on using Generics instead of typical Collections.

Read more ›

Posted in .Net, Asp.net C# Vb.net Interview Question, C#, VB.Net

JQuery Click Event to Highlight a Row of an HTML table with Even Odd CSS

Highlighting a row is very essential when the table is very wide & need to scroll horizontally to read whole row. Using CSS and JQuery it’s very easy to implement, but a bit complex while the table has alternate row color or other conditional/unconditional CSS in it’s cells. Because, before highlighting the row you need to preserve the original style of the row even might be cells to apply those in next highlight. Covering every scenarios is very difficult. So better to concentrate on different techniques & basic in built relevant properties/functions of CSS & JQuery. Such as JQuery index() & hasClass() function. JQuery index() function helps us to retrieve a row number or position of a table, hence we can directly apply Even or Odd CSS based on the number without preserving the previous row number. JQuery hasClass() boolean function helps us to determine whether any of the matched elements are assigned with the given class or not. So we have a lot of ways to highlight an HTML table row having Even & Odd CSS. In this article we will demonstrate some implementations so that you can apply those not only to handle a specific case rather can manipulate whole HTML table CSS using JQuery in every aspects.

Read more ›

Posted in .Net, Asp.net, C#, Client, CSS, Javascript, JQuery, VB.Net

Replace Sub Queries within “IN” or “Not IN” command by JOIN Operator to improve SQL Query Performence

As a developer we have to ensure faster response time of our applications. From our practical experiences, we found that most of the performance degradation are caused by non optimized SQL query. At the very initial stage developers may not experience slow query performance but sooner or later he will realize or acknowledge when database started growing rapidly. So for performance issues we have to concentrate on costly database queries first. Tuning SQL queries is not an easy task. Because lot of parameters may increase query execution time. One of the most common thumb rule for optimizing SQL query is to replace all sub queries within “IN” or “NOT IN” clause. Here in this article we will show you how a sub query decrease the performance and what will be the remedy.

Read more ›

Posted in Database, SQL Server, SQL Server SQL/TSQL Performence Tuning

JQuery to Read HTML Table Row Column Cell Data Records

JQuery or Javascript is an awesome language (though some people don’t want to say language) to improve user experience dramatically. For better user interface we can’t imagine it without JQuery or Javascript. JQuery makes our life more easier. If you are a fan of Javascript, we are requesting you to try JQuery. Why? please start first. Now, we are talking about HTML Table. Table is a major HTML element that we have used a lot. So manipulating table or DOM element using JQuery is a common task in every developer’s life. Here in this article we will guide you “how we can read all Row Column Cell data of an HTML Table using JQuery for each loop”. Also we will discuss a little bit on different JQuery selector’s, we have to use most likely for an HTML Table. So let’s start with example:

Read more ›

Posted in Client, Javascript, JQuery

CSS to Conditionally set Asp.Net Repeater Row Background Colour using C# VB.Net

Asp.Net Repeater Control is used to represent data repeatedly. Sometimes we can use this control to represent data in tabular format. Since more often we use this control, we need to represent data visually meaningful. For such type of user/client requirement we need to apply CSS on Repeater control from server side or from code behind. That’s why in this article we are going to implement “How we can set Asp.Net Repeater Control Row Data Background Color based on business condition“. Though it’s a beginner level tutorial but to implement the below example you have to know some CSS in order to format the Repeater Control Background Color.

Read more ›

Posted in .Net, Asp.net, C#, CSS, Repeater, VB.Net

Getting last ID value of identity column from SQL Server for the most recently inserted record using ASP.Net C# & VB.Net

For the relational database like SQL Server, Oracle, and Microsoft Access/Jet we have to maintain a primary key to establish relation among entities. To do that we can use business code if applicable, but in some cases we have to use Identity Column to identify an entity or record uniquely. These values are generated by the RDBMS as rows are added to a table. To set the identity column of a table, different RDBMS has been exposed different ways like for SQL Server you can set the identity property of a column, for Oracle you can create a Sequence, and for Microsoft Access you can create an AutoNumber column.

Read more ›

Posted in .Net, Asp.net, C#, Database, SQL Server, VB.Net

Jquery to Merge HTML Table Row for same group of data using rowsapn attribute

When we need to represent data in an HTML Table, more often we need to merge same cell value or row td value. Here in this article I will show you “How one can easily merge same group of data of an HTML Table using JQUERY“. To merge the same cell value of a table we need to know the rowspan HTML Table attribute. After iterating each table row we need to compare the previous td/cell value, if same then we need to increase the rowspan value by 1. Simple – isn’t it. Read more ›

Posted in .Net, Asp.net, C#, Client, JQuery, VB.Net

How to get set server side DIV of a Content page from Master page Code behind in Asp.Net C# VB.Net

In my previous post I have described how we can Get & Set value of a Master page DIV control. It’s also equally important to know “how we can Get & Set value of a Content page or Child page from Master Page”. Here in this post I will try to make you understand the way to resolution. For server side controls we can easily cast it by using the control type but for DIV we have to cast it by HtmlGenericControl. Hope now you can understand. Let’s check the issue with an example.

Read more ›

Posted in .Net, Asp.net, C#, VB.Net

How to get set server side DIV of a Master page from Content page Code behind in Asp.Net C# VB.Net

In most of the projects we need get and set Master page DIV tag from our code behind. We knew that we can do it by using Asp.Net FindControl() method. But after that we need to cast to get the InnerText or InnerHtml of the DIV tag. For Asp.Net controls we can directly cast those as control type. But when you need to get or set values of a DIV tag you need to cast it to HtmlGenericControl. Lets check how we can “Get Set server side DIV of a Master page from Content page Code behind using Asp.Net C# VB.Net“.

Read more ›

Posted in .Net, Asp.net, C#, VB.Net

Get Asp.Net Original Unhandled Exception Error Message in JQuery AJAX error Function in C#.Net VB.Net

In my previous articles I have explained how we can invoke or call server side method using JQuery AJAX. Here in this article I will explain “How we can handle ASP.Net WebMethod Unhandled Exception from JQuery AJAX error Function in C#.Net and VB.Net Web Applications“. It’s very important to catch or handle unhandled exceptions from JQuery AJAX function because using this function we can display error message properly to user, Log errors properly as well as it will help us a lot to pin point the error through the ASP.Net server error message and stacktrace. In many forums I found that developers more often confused whenever they did not get proper error message from JQuery error function. It’s for you. Try it. Hope it will resolve your debugging issues.

Read more ›

Posted in .Net, Ajax, Asp.net, C#, Client, JQuery, VB.Net
Share Articles
Contact US
Site meter
Like our fan page
Alexa Rank