Culture and date related problems

P

papaja

Hello,
I have simple Access database, and simple asp.net page with datagrid.
My Regional Settings are set to Serbian (Latin).

When I populate datagrid dates are showed in american format
mm/dd/yyyy. I wanted it in Serbian: dd.mm.yyyy, so I set ---
culture="sr-SP-Latn" uiCulture="sr-SP-Latn"--- in web.config. I worked
nicely.

Later on I added another form for inserting data in database. I used
something like
********************************************************************************
Dim aktuelnaOd, aktuelnaDo As Date
Dim naslov As String
Dim intro As String
Dim novost As String

aktuelnaOd = txtAktuelnaOd.Text
aktuelnaDo = txtAktuelnaDo.Text
naslov = txtNaslov.Text
intro = txtIntro.Text
novost = txtNovost.Text

Dim myExecuteQuery As String = "INSERT INTO tblLITNovosti
(NovostDatumOd, NovostDatumDo, NovostNaslov, NovostIntro, Novost)
Values ('" & aktuelnaOd & "', '" & aktuelnaDo & "', '" & naslov & "',
'" & intro & "', '" & novost & "')"


Dim myCommand As New OleDb.OleDbCommand(myExecuteQuery,
conn)

conn.Open()
myCommand.ExecuteNonQuery()
conn.Close()
********************************************************************************

And I got "Data type mismatch in criteria expression." AS SOON AS I
REMOVE culture info from web.config this works!!!

What to do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top