Hi,
I have followed the technical artical "Remote Data Access Synchronization with SQL Server 2005 Compact Edition and Visual Basic.NET" to create a sample application.
But when I run debug mode and get an exception unexpected as following as doing rad.pull :
Immediate Window:
A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll
Message Box
[Contacts]
Code:
Private Sub RADPullButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RADPullButton.Click
Try
VerifyDatabaseExists()
Dim rda As SqlCeRemoteDataAccess
rda = GetRDAObject()
rda.Pull("Contacts", _
"SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers", _
My.Settings.ServerOleDBNorthwindConnectionString, _
RdaTrackOption.TrackingOnWithIndexes, _
"Contacts_Errors")
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
Windows.Forms.Cursor.Current = Cursors.Default
End Try
End Sub
Thanks in advance,
JD
You need to grab all the error information, by following the guidelines in this topic from SQL CE Books online - Handling Errors in Managed Applications http://msdn2.microsoft.com/en-us/library/ms174079.aspx
|||HI ErikEJ,
I have following the link to catch real sql server compact edition error exception
Here is what I got and I still don't know what this meas:
Error Code:80004005
Message :[Contacts]
Minor Err: 28573
Source: Microsoft SQL Server Compact Edition
Err. Par.: Contacts
Thanks a lot,
JD
|||
There already is a local table with the same name as used in your RDA definition. See this very helpful post by laxmi at http://blogs.msdn.com/sqlservercompact/archive/2007/01/23/rda-subscriptions.aspx
|||I am having a similar problem. When I pull the tables, I also create an error table (tablename_err). If I have to pull a table again, I first drop the table if it exists and then attempt to pull it again. I cannot do this though because when I drop the table, the error table does not get dropped and it will not let me pull a another error table (error 28573). I have attempted to explicitly drop the error table, but I am not allowed to do that either as that generates the 28605 error: "DDL operations on the table are restricted." I did not have this problem with SQLCE 2.0, only since I migrated to SQLMobile (3.0). How do I get rid of the original error tables so that I can pull again?
|||One doesn't has to drop the error tables explicitly. These will be dropped automatically when the associated RDA tracked table is dropped. For e.g.:
rda.pull(@."pulltable", @."select * from foo", <conn string to SQL server>, RDATrackOption.TrackingOn, @."err_pull");
when one drops pulltable, err_pull automatically gets dropped since it is associated with pulltable which is being tracked. Please refer to "Maintaining Error Tables" in http://msdn2.microsoft.com/en-us/library/ms171782.aspx
Could you verify if you are indeed dropping all the local data tables into which you are attempting to pull data?
No comments:
Post a Comment