Help on SQLCE

E

Enver A

Hey ppl! I need help again! Problem is this. This code below belongs to a
buttons click action,And it works perfectly on the first attempt. After i
close the software and re-deploy it, i always meet the exception of
unhandled event in line 1. After i hard-reset the Pocket PC it works
perfectly at the first attempt again. Can anyone tell me whats wrong with
this code?



connection6 = New SqlCeConnection(connstr6)

connection6.Open()



Dim command As SqlCeCommand = connection6.CreateCommand

Dim PARAM1 As String

Dim PARAM2 As String

Dim PARAM3 As String

Dim PARAM4 As String

Dim PARAM5 As String

Dim PARAM6 As String

Dim PARAM7 As String



command.CommandText = "INSERT INTO ARACLAR
(INDEXARC,ARCMARKA,ARCMD,ARCYLPER,ARCLSEBT,LSHVON,LSHVARKA)
VALUES(?,?,?,?,?,?,?)"



'Parameters are being given values

PARAM1 = "00001"

PARAM2 = "ALFA ROMEO"

PARAM3 = "TWINSPARK 1.6"

PARAM4 = "(2003 ve sonrasý)"

PARAM5 = "215/45R17 87W"

PARAM6 = "31"

PARAM7 = "32"

command.Parameters.Add("@INDEXARC", PARAM1)

command.Parameters.Add("@ARCMARKA", PARAM2)

command.Parameters.Add("@ARCMD", PARAM3)

command.Parameters.Add("@ARCYLPER", PARAM4)

command.Parameters.Add("@ARCLSEBT", PARAM5)

command.Parameters.Add("@LSHVON", PARAM6)

command.Parameters.Add("@LSHVARKA", PARAM7)

command.Prepare()

command.ExecuteNonQuery()

MsgBox("1st OK")

connection6.Close()

MsgBox("KAYIT YAPILDI")

connection6.Dispose()
 
E

Enver A

An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException'
occurred in System.Data.SqlServerCe.dll
 
I

Ilya Tumanov [MS]

What are the errors in the errors collection for this exception?
There's an example in VS documentation on how to print these errors, just
look for SqlCeException class.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

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

Top