F
Fabio
Hi to the group
I'm running a vb .Net cf app on a pocket pc 2002.
I updated to .net cf sp2
Could anyone explain me why this function works in so strange way (look
at the comments)?
Public Function ExecuteCommand(ByVal sSql As String) As Boolean
Dim Conn As SqlServerCe.SqlCeConnection
Try
Conn = New SqlServerCe.SqlCeConnection(g_sDB_PALM) '<--
"Data Source = \Program Files\PocketAD\G_PDA.sdf;" it exists
Conn.Open() ' after this statement it jumps on next comment
row
Dim myCommand As SqlServerCe.SqlCeCommand = New
SqlServerCe.SqlCeCommand(sSql, Conn)
myCommand.ExecuteNonQuery()
Conn.Close()
Return True
Catch ex As InvalidOperationException
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error:
ExecuteCommand")
Conn.Close()
Return False ' <-- I don't know why but it jump right
here !!!
Catch SQLe As SqlServerCe.SqlCeException
MsgBox(SQLe.Errors(0).Message,
MsgBoxStyle.Critical, "Error: ExecuteCommand")
Conn.Close()
Return False
Catch e As Exception
MsgBox(e.Message, MsgBoxStyle.Critical, "Error:
ExecuteCommand")
Conn.Close()
Return False
End Try
End Function
If I soft reset the device and unplug from activesync everything goes
fine (if I run the built app directly from the device).
This kind of problem doesnt't occurr on PPC 2003.
Any Ideas?
Thanks a lot
Inviato da www.mynewsgate.net
I'm running a vb .Net cf app on a pocket pc 2002.
I updated to .net cf sp2
Could anyone explain me why this function works in so strange way (look
at the comments)?
Public Function ExecuteCommand(ByVal sSql As String) As Boolean
Dim Conn As SqlServerCe.SqlCeConnection
Try
Conn = New SqlServerCe.SqlCeConnection(g_sDB_PALM) '<--
"Data Source = \Program Files\PocketAD\G_PDA.sdf;" it exists
Conn.Open() ' after this statement it jumps on next comment
row
Dim myCommand As SqlServerCe.SqlCeCommand = New
SqlServerCe.SqlCeCommand(sSql, Conn)
myCommand.ExecuteNonQuery()
Conn.Close()
Return True
Catch ex As InvalidOperationException
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error:
ExecuteCommand")
Conn.Close()
Return False ' <-- I don't know why but it jump right
here !!!
Catch SQLe As SqlServerCe.SqlCeException
MsgBox(SQLe.Errors(0).Message,
MsgBoxStyle.Critical, "Error: ExecuteCommand")
Conn.Close()
Return False
Catch e As Exception
MsgBox(e.Message, MsgBoxStyle.Critical, "Error:
ExecuteCommand")
Conn.Close()
Return False
End Try
End Function
If I soft reset the device and unplug from activesync everything goes
fine (if I run the built app directly from the device).
This kind of problem doesnt't occurr on PPC 2003.
Any Ideas?
Thanks a lot
Inviato da www.mynewsgate.net