Server Error in '/' Application.

Conversion from string "" to type 'Date' is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Conversion from string "" to type 'Date' is not valid.

Source Error:


Line 47:         nsql = "SELECT STUFF.* FROM STUFF WHERE (((STUFF.IDSTUFF)=" & id & "));"
Line 48:         Dim titulo As String = functions.Get_Valor_Campo(nsql, "TITULO")
Line 49:         Dim data_criacao As Date = functions.Get_Valor_Campo(nsql, "DATA_CRIACAO")
Line 50:         Dim tiponoticia As String = functions.Get_Valor_Campo(nsql, "CATEGORIA_PRINCIPAL")
Line 51:         nsql = "SELECT USERS.* FROM USERS WHERE (((USERS.ID)=" & functions.Get_Valor_Campo(nsql, "IDAUTOR") & "));"

Source File: C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\noticias.aspx.vb    Line: 49

Stack Trace:


[InvalidCastException: Conversion from string "" to type 'Date' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(String Value) +154
   categoria.carrega_noticia(String id) in C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\noticias.aspx.vb:49
   categoria.Page_Load(Object Sender, EventArgs E) in C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\noticias.aspx.vb:37
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175