Wednesday, March 7, 2012

RDA pull problem

Hi,

I am new to SQL Mobile programming. I am using SQL Server 2005 Mobile and SQL Express. I have a mobile windows application + .sdf file in the PDA. When i try to pull the table the first time, the table is successfully retrieved to PDA. When i try to pull the table again, i get the following error:

"An unexpected error has occured in TestDb.exe. Select quit and then restart this program, or sleect details for more information.

A duplicate value cannot be inserted into aunique index. [table Name=_sysRDASubscriptions, constraint name=c_LocalTableName] "

The above message indicates, that the table is existing in "_sysRDASubscriptions" table.

I tried dropping the table using SQL Explorer in PDA, but it didn't work out.

I am not sure of how to drop the existing table from the database programatically, and if I drop the table from the database, will this be cleared.

Please help me in resolving this issue. I am in desperate need of an urgent solution for this.

Thanks

Prasanna

You will need to drop the existing table before the next call to RDA.Pull. An error occurs if the table already exists.

Run the following command in SQL Mobile Query Analyzer

DROP TABLE < table_name >
Take a look at SQL Server 2005 Mobile Edition Books Online topic:
"Executing SQL Statements on the SQL Tab"

Thank you!

Syed N. Yousuf

Microsoft Developer Support Professional

This posting is provided “AS IS” with no warranties, and confers no rights.

|||

Hi Syed,

I have already tried dropping the table from SQL Mobile Query Analyzer, and i think even I have already mentioned in the message that i posted previously. So, it will be better if you can read the previous post in detail.

By the way regarding the issue, even after dropping the table using the

"DROP TABLE <TABLENAME>" Query using SQL Mobile Query Analyzer, I didn't succeed. And when i did the same programatically, i don't understand why i get a "Null Reference Exception". I queried the Information_Schema.tables and i found that after i execute the DROP command, the information_schema.tables doesn't have any entries regarding the deleted table. Even after this i get the error. I am not sure how to delete the entries from the _sysRDASubscriptions table. Is it possible to execute queries against this table, either programmatically or manually. Suggest, a method to solve this issue.

Thanks

Prasanna.

|||

Are you really using SQL Express as the source of the tables you are trying to pull? If so, RDA from SQL Mobile to SQL Express is not a licensed or supported scenario.

-Darren Shaffer

|||

Hi Darren,

Our applications have both trial and paid versions. For paid versions, we will be not be using SQL Express, but for trial versions, we need to have SQL Express. So, I need a solution for both SQL Express and other editions as well.

Thanks

Prasanna

|||

About the only way to synchronize data from SQL Mobile to SQL Express is going to be to expose some simple web services that get and put data from/to the SQL Express database. Unlike MSDE, SQL Express has no SQL Agent and hence cannot support merge replication or RDA.

-Darren

No comments:

Post a Comment