Posts

Showing posts with the label Null

Check Empty/ Null value in the Data Table and replace null values with custom value

Image
Below i have used a gridview and putted some data inside gridview containing few null values inside data columns and replacing all null values with string "Data Not Avaialable" :: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class ValueAgainstNull : System.Web.UI.Page {     protected void Page_Load(object sender, EventArgs e)     {         if (!IsPostBack)         {             BindData();         }     }     protected void BindData()     {         DataTable dt = new DataTable();         dt.Columns.Add("UserId", typeof(Int32));         dt.Columns.Add("Name", typeof(string));         dt.Columns.Add("Designation", typeof(s...
go to top image