private bool checkDublicateRoomNO() { bool result = false; SqlDataReader sdr = uc.CheckDublicateTenent(txtMobileNo.Text); if (sdr.HasRows) { sdr.Read(); string roomNo = sdr["t_RoomNo"].ToString(); string t_name = sdr["t_name"].ToString(); string t_MobileNo = sdr["t_MobileNo"].ToString(); result = true; string text = "This Tenants " + t_name + " and " + t_MobileNo + " Already Aloted Room No " + roomNo + " "; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false); } sdr.Close(); return(result); }