public void BindData() { SqlConnection conn = null; SqlDataReader rdr = null; try { conn = dbCon.GetConnectionForAdapter(); SqlCommand cmd = new SqlCommand("MessageTemplateList", conn); cmd.CommandType = CommandType.StoredProcedure; conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { var tb = new DataTable(); tb.Load(dr); conn.Close(); if (tb != null && tb.Rows.Count > 0) { grd.DataSource = tb; grd.DataBind(); } } } catch { } finally { if (conn != null) { conn.Close(); } if (rdr != null) { rdr.Close(); } } }