Saturday, February 25, 2012

RDA Pull error using Microsoft SQL Server Compact Edition 2005

Hello dear all.

I am using a Compact Framework 2.0 on a mobile 5.0 with a local Microsoft SQL Compact Edition 2005 database. The backend database is a Microsoft SQL Server 2005 and I am trying to pull a 45000 rows table (the table has 2 varchars(8) forming a primary key and an INTEGER column).

The statement I issue is the following:

rda.Pull(table.TableName, table.TableQuery, Program.RdaOleDbConnectionString, RdaTrackOption.TrackingOnWithIndexes, table.TableName + "Errors");

The application works perfectly when I am pulling smaller tables (up to 15000 rows) but when I try to pull this one I get the following error details:

sqlCeEx
{""}
base {System.SystemException}: {""}
Errors: {System.Data.SqlServerCe.SqlCeErrorCollection}
errors: {System.Data.SqlServerCe.SqlCeErrorCollection}
HResult: -2147024882
Message: ""
NativeError: 0
Source: "Microsoft SQL Server Compact Edition"

Please have in mind that the handheld on which I deploy does not have an extra storage card.

I have done a thorough internet search and I have found no solution to this problem. I truly rely on you to find the solution.

Thanks in advance,

Steliosvcy.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlce/html/sqlce_troubleconnect.asp

Sounds like a timeout error to me.

HRESULT = -2147012894 = FFFFFFFF80072EE2

Take the 2EE2, Convert back to decimal (12002).
Lookup the error in wininet.h (C:\program files\windows ce something\something\include

//
// Internet API error returns
//

#define INTERNET_ERROR_BASE 12000
#define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2)

How to fix it? Gawd knows. Change the timeout? Let me know how to do that if you find out!! (That's what I'm trying to do at the moment)

Regards,

James.
|||

You can set the oledb timeout (from IIS to SQL) with: Connect Timeout=180 in the connection string (3 minutes in this case).

Code Snippet

Provider=SQLOLEDB; Data Source=mySQLServer; Initial Catalog=NorthWind; user id=sa; password=; Connect Timeout=180;

You may have to adjust to fit your environment.

|||

SqlCeReplication and SqlCeRemoteDataAccess. Both of these have SendTimeout, ReceiveTimeout for IIS connectivity and SQL Server connectivity can be controlled by OLEDB connection string or QueryTimeout on REPL/RDA Object.

Thanks,

Laxmi

No comments:

Post a Comment