Some background:
I'm trying to create a Server/Client Sync scenario for my application using Sync Services for ADO.NET specifically the LocalCache custom tool which sets the whole thing up for me.
My server DB has 5 Tables, all of which are being synchronized to the client application, which now has a SQL Server Compact DB with the same schema as the server DB. I have a dataset with some custom queries that I use to connect my app with the local database.
So far so good.
However in my application when I try to fill one of my tables with the table adapter on my form (the default "fill" method) it gives me the following exception:

No mapping exists from DbType Object to a known SqlDbType.

However, if I continue and do the fill again, IT WORKS without a problem.

Catch ex As Exception
End Try

If I do the above code twice, one right after the other, the first one fails, the second works.

Another point to mention is that this happens only with this datatable, all the other 4 tables in the DB work as expected.

Does anyone have an idea what could be the cause of this?

Thanks a lot

Update: I tried deleting and recreating the Dataset, but nothing changed. Could anyone point me in the right direction for finding help with this?

I finally found the answer to my problem. There was a problem with one of my custom queries on the table adapter - the Update method. Somehow, it prevented the adapter from performing a simple "Fill", but only on the first time around. On the second try the compiler didn't seem to care anymore.

This article has been dead for over six months. Start a new discussion instead.