Hello,
When I try to use raddatepicker.selecteddate for a datetime var I get this error:
Cannot implicitly convert type 'object' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?)
Here is my code:
public partial class RegistroFalla
{
public int ID_Falla { get; set; }
public Nullable<int> Duracion_Falla { get; set; }
public System.DateTime Fecha { get; set; }
public System.DateTime Hora_Deteccion { get; set; }
public System.DateTime Hora_Diagnostico { get; set; }
public System.DateTime Hora_Ocurrencia { get; set; }
public System.DateTime Hora_Recuperacion { get; set; }
public System.DateTime Hora_Solucion { get; set; }
public string Descripcion { get; set; }
public System.DateTime Tiempo_Deteccion { get; set; }
public System.DateTime Tiempo_Recuperacion { get; set; }
public System.DateTime Tiempo_Reparacion { get; set; }
public System.DateTime Tiempo_Respuesta { get; set; }
public string Division { get; set; }
}
var Fallo = new RegistroFallas.Model.RegistroFalla
{
Hora_Ocurrencia = dpOcurrencia.SelectedDate,
Fecha = rdpFecha.SelectedDate,
Descripcion = txtDescripcion.Text,
Hora_Deteccion = rdpDeteccion.SelectedDate,
Hora_Diagnostico = rdpDiagnostico.SelectedDate,
Hora_Solucion = rdpSolucion.SelectedDate,
Hora_Recuperacion = rdpRecuperacion.SelectedDate
};
Thanks,
Jorge
When I try to use raddatepicker.selecteddate for a datetime var I get this error:
Cannot implicitly convert type 'object' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?)
Here is my code:
public partial class RegistroFalla
{
public int ID_Falla { get; set; }
public Nullable<int> Duracion_Falla { get; set; }
public System.DateTime Fecha { get; set; }
public System.DateTime Hora_Deteccion { get; set; }
public System.DateTime Hora_Diagnostico { get; set; }
public System.DateTime Hora_Ocurrencia { get; set; }
public System.DateTime Hora_Recuperacion { get; set; }
public System.DateTime Hora_Solucion { get; set; }
public string Descripcion { get; set; }
public System.DateTime Tiempo_Deteccion { get; set; }
public System.DateTime Tiempo_Recuperacion { get; set; }
public System.DateTime Tiempo_Reparacion { get; set; }
public System.DateTime Tiempo_Respuesta { get; set; }
public string Division { get; set; }
}
var Fallo = new RegistroFallas.Model.RegistroFalla
{
Hora_Ocurrencia = dpOcurrencia.SelectedDate,
Fecha = rdpFecha.SelectedDate,
Descripcion = txtDescripcion.Text,
Hora_Deteccion = rdpDeteccion.SelectedDate,
Hora_Diagnostico = rdpDiagnostico.SelectedDate,
Hora_Solucion = rdpSolucion.SelectedDate,
Hora_Recuperacion = rdpRecuperacion.SelectedDate
};
Thanks,
Jorge