Problem with RDA replication and Sqlserver

N

nono

Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the table on
the PDA and insert datas.

When i click the second time on the button, it fails with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender, System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString = "Provider=sqloledb; Data
Source=YOURDATASOURCE;Initial Catalog=YOURCATALOG; " +
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load time: "+timeTaken2.ToString ());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}
 
T

Tom Pauwels

Hello,

With RDA you need to drop the table you want to pull in the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the local table data
with data from the SQL Server table.

Kind Regards,
 
N

nono

Hello,

thanks for your answer.
So, it's very strange !
The first time, my PDA get the entire table. OK.
But, after, i would like only to synchronise new data like
Merge replication.
How can i do that with RDA ?

thanks,
nono
-----Original Message-----
Hello,

With RDA you need to drop the table you want to pull in the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the local table data
with data from the SQL Server table.

Kind Regards,

nono said:
Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the table on
the PDA and insert datas.

When i click the second time on the button, it fails with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender, System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString = "Provider=sqloledb; Data
Source=YOURDATASOURCE;Initial Catalog=YOURCATALOG; " +
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load time: "+timeTaken2.ToString ());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}


.
 
C

Chris Forsberg [MVP]

The only way to do that with RDA is to pull the changes to a separate table
and manually (on the device) update the previously pulled table. However, as
you mention, this is the purpose of Merge Replication.

--
Chris Forsberg
Microsoft MVP - Mobile Devices
www.businessanyplace.net

nono said:
Hello,

thanks for your answer.
So, it's very strange !
The first time, my PDA get the entire table. OK.
But, after, i would like only to synchronise new data like
Merge replication.
How can i do that with RDA ?

thanks,
nono
-----Original Message-----
Hello,

With RDA you need to drop the table you want to pull in the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the local table data
with data from the SQL Server table.

Kind Regards,

nono said:
Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the table on
the PDA and insert datas.

When i click the second time on the button, it fails with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender, System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString = "Provider=sqloledb; Data
Source=YOURDATASOURCE;Initial Catalog=YOURCATALOG; " +
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load time: "+timeTaken2.ToString ());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}


.
 
N

nono

Hello,
Thanks for your answer.

I have to choose between RDA and replication.
(Is it a good idea with a GPRS connection ?)

So, i try both methods to retrieve data (15 rows with 2
fields ) and bind them on a listcontrol (sqlreader).
Here are the results :

* Merge fusion
- At the first time (snapshot)
between 15 and 20 seconds.
- After (only the changes)
3/4 seconds

* RDA
- 3 / 5 seconds for the pull operation.

So, can you explain me how RDA can be so fast ?
It uses the same DLL than merge replication.
How can i see the activity between this DLL and the PDA ?

Thanks a lot,
nono



-----Original Message-----
The only way to do that with RDA is to pull the changes to a separate table
and manually (on the device) update the previously pulled table. However, as
you mention, this is the purpose of Merge Replication.

--
Chris Forsberg
Microsoft MVP - Mobile Devices
www.businessanyplace.net

nono said:
Hello,

thanks for your answer.
So, it's very strange !
The first time, my PDA get the entire table. OK.
But, after, i would like only to synchronise new data like
Merge replication.
How can i do that with RDA ?

thanks,
nono
-----Original Message-----
Hello,

With RDA you need to drop the table you want to pull in the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the local table data
with data from the SQL Server table.

Kind Regards,

Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the
table
on
the PDA and insert datas.

When i click the second time on the button, it fails with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender, System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString = "Provider=sqloledb; Data
Source=YOURDATASOURCE;Initial Catalog=YOURCATALOG; " +
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load time: "+timeTaken2.ToString ());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}


.


.
 
R

Rick Winscot

nono,

Replication will require a 'peek' at each record to make sure that the data
is up-to-date. Your total overhead for 15 records results in nearly 50 slow
operations plus the final inserts. RDA on the other hand is a different
story. It would be the equivalent of taking an access database, compressing
it with winzip, slapping a checksum on the file, sending it to the handheld,
uncompressing it and inserting the data directly on the device.

Rick Winscot
rickly@zyche dot com



nono said:
Hello,
Thanks for your answer.

I have to choose between RDA and replication.
(Is it a good idea with a GPRS connection ?)

So, i try both methods to retrieve data (15 rows with 2
fields ) and bind them on a listcontrol (sqlreader).
Here are the results :

* Merge fusion
- At the first time (snapshot)
between 15 and 20 seconds.
- After (only the changes)
3/4 seconds

* RDA
- 3 / 5 seconds for the pull operation.

So, can you explain me how RDA can be so fast ?
It uses the same DLL than merge replication.
How can i see the activity between this DLL and the PDA ?

Thanks a lot,
nono



-----Original Message-----
The only way to do that with RDA is to pull the changes to a separate table
and manually (on the device) update the previously pulled table. However, as
you mention, this is the purpose of Merge Replication.

--
Chris Forsberg
Microsoft MVP - Mobile Devices
www.businessanyplace.net

nono said:
Hello,

thanks for your answer.
So, it's very strange !
The first time, my PDA get the entire table. OK.
But, after, i would like only to synchronise new data like
Merge replication.
How can i do that with RDA ?

thanks,
nono

-----Original Message-----
Hello,

With RDA you need to drop the table you want to pull in
the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the
local table data
with data from the SQL Server table.

Kind Regards,

Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the table
on
the PDA and insert datas.

When i click the second time on the button, it fails
with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender,
System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString = "Provider=sqloledb; Data
Source=YOURDATASOURCE;Initial Catalog=YOURCATALOG; " +
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data
Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load time: "+timeTaken2.ToString ());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}


.


.
 
N

nono

Thanks for your answer !
-----Original Message-----
nono,

Replication will require a 'peek' at each record to make sure that the data
is up-to-date. Your total overhead for 15 records results in nearly 50 slow
operations plus the final inserts. RDA on the other hand is a different
story. It would be the equivalent of taking an access database, compressing
it with winzip, slapping a checksum on the file, sending it to the handheld,
uncompressing it and inserting the data directly on the device.

Rick Winscot
rickly@zyche dot com



nono said:
Hello,
Thanks for your answer.

I have to choose between RDA and replication.
(Is it a good idea with a GPRS connection ?)

So, i try both methods to retrieve data (15 rows with 2
fields ) and bind them on a listcontrol (sqlreader).
Here are the results :

* Merge fusion
- At the first time (snapshot)
between 15 and 20 seconds.
- After (only the changes)
3/4 seconds

* RDA
- 3 / 5 seconds for the pull operation.

So, can you explain me how RDA can be so fast ?
It uses the same DLL than merge replication.
How can i see the activity between this DLL and the PDA ?

Thanks a lot,
nono



-----Original Message-----
The only way to do that with RDA is to pull the changes to a separate table
and manually (on the device) update the previously
pulled
table. However, as
you mention, this is the purpose of Merge Replication.

--
Chris Forsberg
Microsoft MVP - Mobile Devices
www.businessanyplace.net

Hello,

thanks for your answer.
So, it's very strange !
The first time, my PDA get the entire table. OK.
But, after, i would like only to synchronise new data like
Merge replication.
How can i do that with RDA ?

thanks,
nono

-----Original Message-----
Hello,

With RDA you need to drop the table you want to pull in
the SQL CE database
first before you can pull it again.

From books online of SQL Server CE :
a.. A table must be deleted and repulled to refresh the
local table data
with data from the SQL Server table.

Kind Regards,

Hello,

i use SqlCeRemoteDataAccess() and Pull method to
synchronise SQL CE and SQL 2000 databases.

When i click the first time on the "synchronize" button,
it works well and it's very fast. It creates the table
on
the PDA and insert datas.

When i click the second time on the button, it fails
with
the following error message :
"The LocalTableName parameter is already specified.
[,,, Table name,,]".

Why ?
Any idea ? (see the code below)
Thanks
nono

private void button2_Click(object sender,
System.EventArgs
e)
{
// Connection string to the instance of SQL Server
string rdaOleDbConnectString
= "Provider=sqloledb;
Data
Source=YOURDATASOURCE;Initial
Catalog=YOURCATALOG; "
+
"User Id=sa;Password=sa";

// Oracle connection's string
//string rdaOleDbConnectString
=@"Password=YOURPASSWORD;User ID=YOURUSER;Data
Source=YOURDATASOURCE";

// Initialize the RDA object.
SqlCeRemoteDataAccess rda = null;

try
{
//Try the Pull operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "YOUR LOGIN";
rda.InternetPassword = "";
rda.InternetUrl
= "http://YOURSERVER/sqlce/sscesa20.dll";
rda.LocalConnectionString
= "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data
Source="
+ @"\my documents\YOURFILE.sdf";

Int32 inter = Environment.TickCount ;
rda.Pull("DESTINATIONTABLE","Select FIELDS from
SOURCETABLE",
rdaOleDbConnectString,
RdaTrackOption.TrackingOff ); /* ,
"ErrorTable");*/
Int32 timeTaken2 = Environment.TickCount-inter ;
MessageBox .Show ("Load
time: "+timeTaken2.ToString
());
}
catch(SqlCeException EX)
{
//Use your own error handling routine.
MessageBox .Show (EX.Message );
}
finally
{
//Dispose of the RDA object.
rda.Dispose();
}

}


.



.


.
 

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