Fechas en SQL y web developer!
Publicado por Sheila (1 intervención) el 20/07/2006 18:21:15
Tengo un problema con fechas ojala me puedan ayudar, les platico estoy desarrollando una aplicación en WEB DEVELOPER 2005 en lenguaje VB con conexión a una base de datos en SQL Server 2000 cuando agrego la fecha por medio del mi sentencia para insertar no envía error y en teoria lo agrega sin problemas, pero al verificar el valor que agrega a la base de datos envía 01/01/1900 12:00:00 a.m. siempre.
Les dejo el código:
Dim Fecha As Date
Fecha = FormatDateTime(Date.Now, DateFormat.LongDate)
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "INSERT INTO Tb_Indicators (Cve_Desempeno,Proceso,Responsable,Departamento," & _ "Formula,Indice_Medicion,Observaciones,Periodo,Fecha_Registro,Cve_Desempeno_principal) " & _
"Values(" & TxtClave.Text & ",'" & TxtProceso.Text & "','" & TxtResponsable.Text & "','" & TxtDepartamento.Text & "', " & _
"'" & TxtFormula.Text & "'," & TxtIndice.Text & ",'" & TxtObservaciones.Text & "'," & IPeriodo & "," & Fecha & ", '" & ICveDesempeno & "')"
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
Gracias por su ayuda!
Les dejo el código:
Dim Fecha As Date
Fecha = FormatDateTime(Date.Now, DateFormat.LongDate)
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "INSERT INTO Tb_Indicators (Cve_Desempeno,Proceso,Responsable,Departamento," & _ "Formula,Indice_Medicion,Observaciones,Periodo,Fecha_Registro,Cve_Desempeno_principal) " & _
"Values(" & TxtClave.Text & ",'" & TxtProceso.Text & "','" & TxtResponsable.Text & "','" & TxtDepartamento.Text & "', " & _
"'" & TxtFormula.Text & "'," & TxtIndice.Text & ",'" & TxtObservaciones.Text & "'," & IPeriodo & "," & Fecha & ", '" & ICveDesempeno & "')"
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
Gracias por su ayuda!
Valora esta pregunta


0