Matt,
There is a lot more information hiding inside the SqlCeException that is being thrown that you'll need to troubleshoot this situation. Here is some code to unwrap the exception and get specifics.
Public Sub DisplaySQLCEErrors(ByVal ex As SqlCeException)
Dim errorCollection As SqlCeErrorCollection = ex.Errors Dim bld As New StringBuilder() Dim inner As Exception = ex.InnerException Dim err As SqlCeError
For Each err In errorCollection
bld.Append(ControlChars.Lf + " Error Code: " + err.HResult.ToString()) bld.Append(ControlChars.Lf + " Message : " + err.Message) bld.Append(ControlChars.Lf + " Minor Err.: " + err.NativeError.ToString()) bld.Append(ControlChars.Lf + " Source : " + err.Source)
Dim numPar As Integer For Each numPar In err.NumericErrorParameters If (numPar <> 0) Then bld.Append(ControlChars.Lf + " Num. Par. : " + numPar.ToString()) End If Next numPar Dim errPar As String For Each errPar In err.ErrorParameters If (errPar <> String.Empty) Then bld.Append(ControlChars.Lf + " Err. Par. : " + errPar) End If Next errPar
MessageBox.Show(bld.ToString(), "SQL Mobile Error")
Next err
End Sub
-Darren
.NET Compact Framework MVP |