Re: Problem with Insert and Datetime



The colums defined as datetime.

TxtData.Text = DateTime.Now.Date
prezzo1 = TxtRata.Text
prezzo1 = Replace(prezzo1, ",", ".")
Dim cn As New SqlCeConnection(cs)
Dim sql As String = ("INSERT INTO INCASSI (CAMPODATA,RATA,IDANAGRAFICA)
VALUES (" & TxtData.Text & "," & prezzo1 & "," & IdAnag & ")")
cn.Open()
Dim cmd As New SqlCeCommand(sql, cn)
cmd.ExecuteNonQuery()
cn.Close()

I sincronyze MSDE 2000 with RDA pull/push


"Darren Shaffer" wrote:

> Raffaele,
>
> Some questions:
>
> Is the column defined as a datetime? Do you have a default/Date function
> set on the column?
> could you post your code that is doing the insert and the values you are
> inserting?
>
> The earliest datetime supported is Jan 1, 1753 and that is not locale
> specific, so all
> I can think of is that you are either really inserting Jan 1, 1900 or you
> have a default
> set on the column.
>
> --
> Darren Shaffer
> ..NET Compact Framework MVP
> Principal Architect
> Connected Innovation
> www.connectedinnovation.com
>
>
> "Raffaele" <Raffaele@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:249776F9-0ACD-4C67-9A84-1285467DB510@xxxxxxxxxxxxxxxx
> > Hi,
> >
> > i use sqlce italian version, and when i try to insert a datetime value in
> > the row i have 1900-01-01 00:00:00.
> >
> > Can help me?
> >
> > Raffaele
>
>
>
.



Relevant Pages