Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/01/2007, 15:12
Fendi
 
Fecha de Ingreso: octubre-2006
Mensajes: 1
Antigüedad: 17 años, 6 meses
Puntos: 0
Tengo un gran problema con esto de string a datetime

me explico estoy leyendo una celda de Excel la celda tiene un valor Date de forma hh:mm, sucede que la aplicación lo lee de tipo string y lo trasmforma como en valores decimales por ejemplo: 0:05 es igual a 0.003472222 hasta ese momento va todo bien pero ya en la aplicación ASP.net yo quiero volver a ponerlo 0:05, pero cuando utilizo los metodos de conversion como el Cdate(valor) me sale el siguiente error.



System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidCastException: Conversion from string "0.00347222222222222" to type 'Date' is not valid.

at Microsoft.VisualBasic.CompilerServices.Conversions .ToDate(String Value)

at Microsoft.VisualBasic.CompilerServices.Conversions .ToDate(Object Value)

at Service.SECUENCIADEEVENTO(String sFilename, String SourceData, String SourceSection) in c:\inetpub\wwwroot\xlsws_vpn\App_Code\Service.vb:l ine 1933

at Service.Upload_XLSData(String sFilename, String sSourceData, String sSourceSection) in c:\inetpub\wwwroot\xlsws_vpn\App_Code\Service.vb:l ine 667

--- End of inner exception stack trace ---

las gracias anticipadas