collect data with different devices and copy (RDA) it to a sql server 2000 table ?

T

Thomas P.

Hi,

I use RDA to synchronize my pocket pc's database with the sql server
2000 of my company.

My application (vb.net) only adds new rows to the sqlserverce
database. Existing rows will not be changed. My application is a data
collecting application. All works fine if I use only ONE pocket pc.
But if I synchronzie two pocket pc I get an error if I try to pull the
changes of the second pocket pc to the sql server. I think that the
problem of the second device is that the first device changed the
table on the sql server, what is normal for the pull action.
Is there any way to copy the collected data from more pocket pc's to
one table on the sql server?

what I need:

- one table on the sql server 2000
- the pocket pc's only collect new data (at the moment they have the
complete table from the sql server in the sqlserverce database because
I use RDA but It would be enough if the pocket pc only saves the new
collected data)
- add the new collected data to the (end of the) table on the sql
server (here is my problem: I like to collect new data with different
pocket pcs's at the same time)
- I will not need to change data which is located on the sql server
with my pocket pcs's - they only collect new data.

what is the best way to do this?
Thanks.

Regards,

Thomas
 
M

Mahesh ChandraMouli[MVP]

Hi Thomas,

Can you try Webservice option, invoke a webservice and
sink into the SQL 2000. Since ur datavolume is not so
high... try this option and let me know if you have
queries.


Regards
Mahesh ChandraMouli
Microsoft .NET MVP|MCAD (Charter Member)
 
C

chris-s

I imagine you are employing the full RDA replication methods, you could try
'pulling' the tables without any tracking and then running insert statements
using the rda.subbmitsql method to upload the data. You can include multiple
insert statements in each call which gives good performance. In our
experience this works far quicker than using web services and you don't have
any of the potential pit falls involved with replication.

Chris
 
T

Thomas Peterson

Hi Mahesh,

thanks for your response. But I am a programming newbie and I realy
don't know what you mean with "Webservice option" Can you perhaps post
some sample code or give me a link where I can find more information
about this.

Thomas
 
T

Thomas Peterson

Hi Chris,

the idea of using insert statements sounds good. A few days ago I also
had this idea but I wasn't able to write working sourcecode for this. Do
you perhaps have a short sample for me who such a call will look like.
Thnaks.

Regards,

Thomas
 
C

chris-s

Try something like the following...


string m_OLEDBConnStr = "Provider=sqloledb; Data Source=192.168.0.1;Initial
Catalog=Northwind;User Id=sa;Password=sa";
SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
rda.InternetUrl = "http://192.168.0.1/ssce/sscesa20.dll";
rda.InternetLogin = "";
rda.InternetPassword = "" ;
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data
Source=\My Documents\MyDB.sdf";
rda.SubmitSql("insert into region values (23,'region 23')",
rdaOleDbConnStr );


....this assumes that you have the Northwind db, sscesa20dll etc all running
on pc with ip of 192.168.0.1.

Chris
 
T

Thomas Peterson

Hi Chris,

thanks for your code sample.
I just tried it and now it works.
A also used code samples from the book "SQL Server CE Database
Development with the .NET Compact Framework" from Rob Tiffany.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top