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

JQuery AJAX Example Code in Asp.net to Insert or Save Data into SQL Server Database without Postback in C#.Net VB.Net

In almost each and every web application we need to save or insert data into database. To save or insert data into database we need to postback into the server. Using AJAX we can provide the functionality without refreshing the browser. JQuery Ajax provides us an easier option to easily integrate Ajax functionality in ASP.Net web applications. In this article I will discuss “How to Save or Insert Data into SQL Server Databse using JQuery AJAX in ASP.Net C# and VB.Net Application“. By reading this article one can also learn how to integrate JQuery AJAX in ASP.Net applications.

Read more ›

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

How to Check or Handle NULL Values in Where Clause in SQL Server

NULL is an interesting value in any relational Database. Sometimes its same (for Grouping), some times not (for equality). In many cases we need to identify records those contains NULL value. Some times we need to discard records if any specific column contains NULL values. So as a developer handling NULL values in WHERE clause is common. Here I will discuss how we can “Handle NULL values in SQL WHERE clause“.

Read more ›

Posted in Database, SQL Server

Efficient way to Save or Insert TextBox Value into MS Access DataBase Table In Asp.net Using C#.Net VB.Net

We can use MS Access Database for small scale applications. Asp.net Ado.Net provides us an easy, efficient way to develop Database driven application using MS Access as back end. To start an application here I have described “How to Insert or Save TextBox Data into MS Access Database Table in an efficient way“. Hope this example will help you to go further.

Read more ›

Posted in .Net, Asp.net, C#, Database, MS Access, VB.Net

Runtime Bind Data from SQL Server Table to Datagridview in Windows Application in C# VB.NET

DataGridView is an essential control for windows applications. This control can be used in both C#.Net windows applications as well as VB.Net Applications. Specially we use this control for tabular data representation. Here in this article I will show “How to Bind SQL Server Table Data to Datagridview in Windows Applications“. To do the example we need to create a Table first. After that from run time we will bind the SQL Server Table Data into the DataGridView control.

Read more ›

Posted in .Net, C#, Database, DataGridView, SQL Server, VB.Net