I've got a system that RDA my SDF local database to a SQL server database. The SDF now allows the system to store 1GB of data, but the RDA client does not allow me to push or pull.
When I look within the RDA element it has a Max database size of 256. When I only set the LocalConnectionString string to "Data Source=ehc.sdf;Password=xx;"
Before setting the LocalConnectionString to the true connection string, it is null. Once the connection string is set, with the above string the LocalConnectionString contains the below string. (Running in debug, once you move of the set line, the string is manipulated. I have not invoked anything)
"ssce:default lock escalation=\"100\";data source=\"\ehc.sdf\";ssce:max database size=\"256\";ssce:default lock timeout=\"5000\";ssce:max buffer size=\"4096\";ssce:temp file max size=\"256\";ssce:enlist=\"True\";ssce:autoshrink threshold=\"60\";ssce:flush interval=\"10\";ssce:database password=\"xxxx\";"
Within the string it states ssce:max database size=\"256\", when I have not set it.
So I Used a replace to replace the "ssce:max database size=\"256\"" to "ssce:max database size=\"1091\""
After this change I now get the below error.
"Another user has opened the database with different instance-level initialization properties."
If I set the LocalConnectionString to ""Data Source=\ehc.sdf;Password=xxxx;Max Database Size=1091;Persist Security Info=False;"" the LocalConnectionString is set to the below string and the RDA client gives me the below error
"ssce:default lock escalation=\"100\";persist security info=\"False\";data source=\"E:\\Work\\Development\\Current\\HealthOptions\\HealthOptions\\Branches\\9.2.0-Interventions\\hdinput\\bin\\x86\\Debug\\ehc.sdf\";ssce:autoshrink threshold=\"60\";ssce:max buffer size=\"4096\";ssce:temp file max size=\"256\";ssce:enlist=\"True\";ssce:max database size=\"1091\";ssce:flush interval=\"10\";ssce:default lock timeout=\"5000\";ssce:database password=\"xxxxx\";"
"The specified OLE DB for SQL Server Compact connection string is not valid."
Does anyone know why this is happening? Why the LocalConnectionString is manipulating my connection string, when I'm setting it? How I can get around my errors.
The SqlCeRemoteDataAccess DLL Assembly Version is v3.5.1.0
After looking more and more and after reading the below point from the below url. I tried just adding the ";Max Database Size=1091;" value to the connection string.
The new LocalConnectionString value now contain the correct Max database allowance and RDA does not report any errors.
I'm assuming, because I've attempted to manipulate or add too many properties, it was not happy.
So the final cope is:
rda.LocalConnectionString = "Data Source=ehc.sdf;Password=xx;" + ";Max Database Size=1091;"
NOT
"Data Source=\ehc.sdf;Password=xxx;Max Database Size=1091;Persist Security Info=False;"
URL with the point https://technet.microsoft.com/en-us/library/ms173248%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
The point that made me think twice If a property name occurs more than one time in the connection string, the value associated with the last occurrence is used.