.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Server Compact 3.5 nvarchar limitation

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server


I have a table with one column (nvarchar) with a length >127. Everything is working fine until I want to make a simple SELECT * FROM table_1, which results in error. Error message: "Object was open".

I connect to the database using ADOConnection "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5". No prob to insert more than 127 characters in the column with an INSERT INTO command. No problems to update a row. But there's just no way to make a SELECT!

Is there a fix for this... bug(?) ? Workaround? It's really annoying.

Thank you.



View Complete Post

More Related Resource Links

Entity Framework + SQL server 2008 compact edition: limitation?


any limitation with SQL Server 2008 compact edtion with Entity Framework 4?



Go Mobile: Create Compact, Robust Mobile Apps with SQL Server CE 2.0 and the .NET Compact Framework


Developers have myriad options when it comes to creating solutions for mobile devices. One of the greatest challenges facing mobile developers is finding a compact yet robust local storage solution. SQL Server CE 2.0 promises to deliver on both fronts. This new release represents a tremendous leap in terms of features and performance over its predecessor. This article will review some of the platform and tools choices developers have today. The authors will compare and contrast the significant new features in SQL Server CE 2.0 with the previous release. Following that, they will build a sample app for illustration.

Mark Brown and David Meunier

MSDN Magazine January 2003

Getting Started with SQL Server Compact 4.0 and ASP.NET 4

The article Getting Started with SQL Server Compact 4.0 and ASP.NET 4 was added by tmorton on Monday, August 09, 2010.

While professional developers are waiting for the Visual Studio Tools and Designers for SQL Server Compact 4.0, I will show how impatient developers can include SQL Server Compact with ASP.NET applications, and use it from ASP.NET pages. Previously, you

Creating a recordset using VBA in Excel with SQL Server Compact

I have create a SQL Server Compact database from VBA in Excel.  So far so good.  Now I want to access the database via a recordset.  here is my code.        Set recSet = New ADODB.Recordset        recSet.LockType = adLockBatchOptimistic     recSet.CursorType = adOpenKeyset     Call recSet.Open("SELECT * FROM SPAR", dbConn)   When I run this I get and error in Call recSet.Open("SELECT * FROM SPAR", dbConn):Errors Occurred, [,,,,]  I have search many forums about his problem, but I still can't see where the error is from.  I am using Excel 2003, and SQL Server Compact 3.5   Regards, Peter

ODBC Driver for SQL Server Compact Edition

I know that there is no ODBC driver available for SQL Server Compact Edition version 3.5.  Do you plan to add an ODBC driver in future release? If yes, is it high in your priority list?   The scenario why I am looking for an ODBC driver is to connect an MS Access application to a SDF file instead of MDB file.  This will enable me to easily sync the SDF file with SQL server repository using the new Data Sync Services.   Mario Cardinal MVP Solutions Architect

SQL Server Compact 4 replication library bug ?

I get the subscriber connection string from a SqlCeReplication object like so: public string GetFullConnectionString(string connectionString) { using (SqlCeReplication repl = new SqlCeReplication()) { repl.SubscriberConnectionString = connectionString; return repl.SubscriberConnectionString; } } With a connection string of: "Data Source=C:\data\nw(40).sdf" I get this from 3.5.8081: ssce:default lock timeout="5000";data source="C:\Data\nw.sdf";ssce:max database size="256";ssce:max buffer size="4096";ssce:temp file max size="256";ssce:enlist="True";ssce:default lock escalation="100";ssce:autoshrink threshold="60";ssce:flush interval="10"; But I get this from 4.0 CTP 1: "Autoshrink Threshold=\"60\";Case Sensitive=\"False\";Data Source=\"C:\\data\\nw40.sdf\";Default Lock Escalation=\"100\";Default Lock Timeout=\"5000\";Encrypt Database=\"False\";Encryption Mode=\"\";Enlist=\"True\";Mode=\"Read Write\";Flush Interval=\"10\";Locale Identifier=\"-1\";Max Buffer Size=\"4096\";Max Database Size=\"256\";Password=\"\";Persist Security Info=\"False\";Temp File Max Size=\"256\";Temp File Directory=\"

SQL Server Compact loses change tracking anchors when copied to device

I have a device app that use SQL Compact and uses sync framework to synchronize to a SQL Server 2008 instance.  In order to speed up the initial synchronization of my device app, I'm creating the database (.sdf) using the sync framework on the server based on the suggestion in this article: http://msdn.microsoft.com/en-us/library/dd938879.aspx#HandlingInitialSynchronizationandExpiredSubscriptions Then I get it via a WCF service down to the device app.  I'm able to download the db and it has data.  When I sync however, the database doesn't seem to think it is syncronized.  It seems to have lost it's anchors.   The following code returns an anchor for my State table on the server, but not after copying it to the device. Any suggestions are appreciated.  Thanks FPASQLCeClientSyncProvider).GetTableReceivedAnchor("State")

SQL Server Compact 3.5 Encryption Questions

If I create a database (.sdf file) on a server and set it to be encrypted, should it be able to be opened on a device or other PC?  In other words, is there anything in the encryption that is machine specific?  Or is it really that the password is what lets me connect and the encryption prevents it from being read by some other tool like a hex file viewer as one post suggested. I've read through lots of posts and documentation and I'm just trying to understand how encryption works and if there are any limitations or considerations and haven't found a good source. Thanks

Chunking to ntext / image columns in SQL Server Compact 3.5

Hi all! I'm trying to store (potentially) large files in a SDF, via a table with an image column.  Image columns hold up to 2GB. Every SQL CE example I've found which does this reads the whole file into a Byte array, then passes the array in a SqlCeParameter.   This is fine assuming that the file is small, or the code is run on a machine with plenty of memory.  But if, for example, you're trying to store a 1GB file on a PC with 512Mb, the whole file cannot be buffered in one go (without paging). What I want to be able to do is read and store "chunks" of a file into an image col.  E.g. http://support.microsoft.com/kb/317034    I think this approach is both faster and more mem efficient.   It is possible on SQL Server 2008 etc., using either UPDATETEXT or UPDATE ... [column name].write( ..., ..., ...).   However, SQL CE doesn't appear to support either syntax. So, I guess my question boils down to: is it possible to store a 2Gb file in an SQL CE image column on a PC with 1GB of mem. (without spending ages paging) Thanks in advance, Ben.

SQL Server to SQL Server Compact Edition Database Copy

I recently switched from XP to Win 7 and am getting an error when using the SQL Server to SQL Server Compact Edition Database Copy wizard from johnnycantcode.com (link). I suspect that the problem is with the configuration of the path for the DQL CE dll. 1) Does anyone know where the configuration is set? It isn't in the GLT.SqlCopy.exe.config file in the local directory. 2) Has anyone got the program to run under Win 7? Thanks marc  

SQL server compact deployment help

I have a very simple windows desktop app I am trying to deploy using windows installer. I also have a SQL Server compact database file or (Local Database). When I deploy the app and try installing it on my test computer, I get an error saying the database was not found and then it displays the connection string that was set originally in Visual Studio. The application runs but all the database in not there. I don't understand why there is even a connection string there if the database in embedded in the application. Which is one of the benefits of SQL Server  Compact. What should change the connection string to?? Anyone have experience using SQl Server Compact for Win Forms?

Will SQL Server Compact feature an updated and more capable OLEDB driver

Hi, Earlier, we found problems with using SQL CE 3.5 via OLEDB. While some limited functionality was available and data can be accessed via commands and recordset via OLEDB/ADO from, say, Excel or Access, we were unable to access SQL CE directly from other data-driven packages that nominally support OLEDB, most importantly SAS and SPSS. So our question is whether SQL Server Compact will feature an updated and more capable OLEDB driver? Thx and regards, Ralph

how can I open a sql compact 4.0 DB from VS 2010 server explorer ?

Hi, I've downloaded the latest sql compact 4.0 beta, and I follow the Scott Guthrie sample (http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx). It is working as expected, the DB is created. However, I cannot open the DB in the server explorer of VS (neither from sql management studio). An error telling me the version of the file is not supported is thrown. Note that I only have the 3.5 version in the provider list in the add connection wizard. What is missing ? thanks in advance for the help. stevePaying back the community for its help by writing articles : Have a Nice Day.Net Blog

Cannot select 'SQL Server Compact Edition' from Server Type drop down

I have seen this issue addressed for SQL Server 2005 but not 2008. I have installed these components:SQL Server 2008 (Browser, Management Objects, Native Client, Policies and Setup Support Files)SQL Server Compact 3.5 (for Devies, Server Tools and SP1)In the SQL Server Management Studio, on the Connect to Server dialog, the "Server Type" drop down list is disabled and "Database engine" is the default. Does anyone know what I need to do to make "SQL Server Compact Edition" a choice in the "Server Type" drop down list?

SQL Server Compact Edition ORM

Hi!I need an ORM library for SQL CE 3.5 SP1. Are there any solutions available?Regards,Dawid Ireno

Introducing SQL Server Compact Edition 4

Hi, I just downloaded the above but when I look in visual web developer 2010 express I see no data provider reference . I was wondering how to attach/create db? in the above, is it a clickable option in tools .net framework options or is VS 2010 not ready to use SQL CE 4 yet, Any help/suggestions/your time in anwering this question greatly appreciated    
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend