public void BindAccessDelgrid(string state, long UserId) { DataTable dt = new DataTable(); DataSet ds = new DataSet(); CustomProfile profile = CustomProfile.GetProfile(); iUserCreationClient userClient = new iUserCreationClient(); try { ds = userClient.GetUserDelegationDetail(state, UserId, profile.DBConnection._constr); dt = ds.Tables[0]; if (dt.Rows.Count > 0) { grdaccessdele.DataSource = ds.Tables[0]; grdaccessdele.DataBind(); } else { grdaccessdele.DataSource = null; grdaccessdele.DataBind(); } } catch (Exception ex) { Login.Profile.ErrorHandling(ex, this, "Access Delegation", "BindAccessDelgrid"); } finally { userClient.Close(); } }