Hazel Ortiz

Generation

generate functionThu, 13 Jul 2023

validar si en la fecha ingresada en el txt hay datos en la base de datos c# asp

public bool ExisteFecha(string fecha) { bool resultado = false; using (var context = new PruebaEntities()) { var fecha_res = context.Database.SqlQuery<string>("select fecha from prueba where fecha = '" + fecha + "'").FirstOrDefault(); if (fecha_res != null) { resultado = true; } } return resultado; }

Questions about programming?Chat with your personal AI assistant