Compact Edition Database In Object Store On Windows CE 4.2
Oct 10, 2007
The device I'm working on has a filesystem on compact flash, but we're concerned about burning it up with excessive writes. One solution might be to keep the SQL database in the the object store, perhaps dumping a copy out to the CF as backup. Any pointers as to how to accomplish this? If we were to keep the db in a file on the CF, what's the SQL Server CE behavior for writing to the file? Does it write every time a record is created/updated, or is there any ability to control when the data is flushed to the file?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DBPath As String
Dim mydr As XmlTextReader = New XmlTextReader(m_sXMLFileName) mydr.WhitespaceHandling = WhitespaceHandling.None
While mydr.Read() ' Look for the <configuration> section ' This lets us add several peices in the config file If mydr.Name = "DBPath" Then DBPath = mydr.Name End If End While mydr.Close()
Me.MobileDataTableAdapter.Connection.ConnectionString = "Data Source =""Program FilesCEdatabaseMobileDatabase.sdf"";" Try If MobileDatabaseDataSetUtil.DesignerUtil.IsRunTime Then 'TODO: Delete this line of code to remove the default AutoFill for 'MobileDatabaseDataSet.MobileData'. Me.MobileDataTableAdapter.Fill(Me.MobileDatabaseDataSet.MobileData) End If
Catch ex As SqlCeException MessageBox.Show(ex.Message) End Try End Sub
Hi, I can't seem to find which SQL Server Compact Edition version is pre-installed on the Windows Mobile 6 rom. I guess it is 3.0, but I'm not sure about it. Another question is, if I use SQL Server Compact Edition 3.5 by deploying the .dll files as part of my application's CAB installer, will this be a problem for Windows Mobile 5 or Windows Mobile 6? Thank you in advance,
we've got a SQL Server 2005 which replicates with an SQL Server Compact 3.5. Every 10 to 20 synchronisations we're getting the error mentioned above. A Soft reset of the device helps to make the synchronization working again.
Why is this error happening and how can we resolve this?
BTW, we've also running system that replicates with an SQL Server Compact 3.0 without having this problems.
I need to create a desktop program on vb.net , based SQL compact edition. but I do not know how to connect to CE database. I already create the sdf file, but I can not connect it from the poject , is there any way to do it ?
everything is ok for first run. but i leave the program relogin than that error occured ppc2003 second edition devices. Windows mobile 5.0 device works fine. can anybody help me?
VS2005 ver 8.0.50727 SSCE31VSTools-ENU.exe loaded SSCE31SDK-ENU.msi loaded
machine 1 SQL 2005 loaded
machine 2 http://192.168.20.22/ssce/sqlcesa30.dll "Microsoft SQL Server Compact Edition Server Agent" looks fine
pocket pc side C:Program FilesMicrosoft SQL Server Compact Editionv3.1SDKinwce400armv4
End Try ------------------------------------------------------------------------------ i added the following code to very beginning of my code too. that code lock my device
Declare Function LoadLibrary Lib "coredll" Alias "LoadLibrary" (ByVal lpLibFileName As String) As IntPtr
We have a plan to use Microsoft SQL Server 2005 Compact Edition RC1 as a backend. Our Front-end is VS .NET (VB.NET).
We want to know how to edit the Compact Edition database (.SDF). Is there any editor is available right now in the market? or microsoft provided any editor for this.
OR Can i use microsoft 2005 sql server standard edition for this.
I'll try and ask one more time. Does anyone have a clue how to fix this?
"A SQL Server Compact Edition DLL could not be loaded. Reinstall SQL Server Compact Edition. [ DLL Name = sqlceca30.dll ]"
or
"SQL Server Compact Edition encountered problems when opening the database" "Internal error: The database is not initialized."
I've been fighting this for well over a week now. My XP based version works fine but this error occurs routinely on my CE4.2 device. I cannot find anything meaningful using Google other than 'look for non disposed' replication objects which I've done. Is this bad hardware? I don't believe I'm out of memory as the app is about 1.2MB including about 8 DLL's and GC indicates I have about 300KB of objects at the time of the failure. I also use a bunch of static (global) objects that I use throughout the code.
It would be nice if I could get the lower level error messages causing these failures but that is probably too much to ask.
The odd thing is that it's only the replication engine that fails as even after the failure, the app can reopen the DB and work with the data just fine.
My basic order of the application is...
1 Open DB SqlCEConnection 2 Create/Prepare any SqlCECommand objects 3 Do work here 4 Dispose any SqlCECommand objects 5 Close DB 6 Dispose SqlCEConnection object 7 Create SqlCEReplication object 8 BeginSynchronize 9 ... error here.. 10 Dispose SqlCEReplication object 11 Reopen DB SqlCEConnection
I've tried creating the Replication object at program start and that does not help. I'm guessing there is something about .net that I don't understand either with stack space, # dll's or whatever. I've rearranged the order of the Dispose, Create, SQL CE objects to include just about every permutation but still am hitting this same problem.
Are there any tools that can help me profile this app for memory problems or usage? Everything seems geared for .Net and not .NetCF.
How Can I get Identitiy field from database while inserting new row in sql server 2005 compact edition.
Ex:
I am inserting row in a table through SqlQuery ("insert into ....") in which one of the field is of type Identity which generates number automatically. I want that number to pick up that number and used it in child table....
I need to grant select, insert, update, and delete permission to an object residing in Database "X" from a store procedure in database "Y". I have already tried USE database statement. Any suggestion. Thanks Maroof Khan
Now I need to store the oMyClass object in the database for later use, at which point I would get it out of the database, cast it back to myClass, and be able to acess its properties, etc. My problem is that the classes that I am working with are not serializable, so I cannot store the objects as XML. Does anyone have an example of doing this programmatically with C# and ADO.NET. I am assuming that I would have to store it in a vabinary column, but how do I get it in there. Any help would be greatly appreciated. Thanks.
I am attempting to use the SQL Server 2008 Developer Edition (Management Studio) to create/manage a Compact Edition 3.5 database. My problem is that I cannot even create/open the compact database in Management Studio. Any help would be GREATLY appreciated. TIA
Problem Creating the Compact Database:
Open 2008 Management Studio
From menu choose File | Connect Object Explorer...
Choose SQL Server Compact Edition as the Server type.
Choose <New Database...> as the Database file.
Browse to folder where file will be created (C:MyDatabase#1.sdf was used in my example)
Leave all other field as default selections OR make changes, either way it does not work.
Click OK.
At this point the OK button just becomes disabled and nothing happens. Problem Opening An Existing Compact Database:
Open 2008 Management Studio
From menu choose File | Connect Object Explorer...
Choose SQL Server Compact Edition as the Server type.
Choose <Browse for more...> as the Database file and locate a ".sdf" file that I created using VS2008.
Enter password, if any.
Click OK.
The following exception is displayed: TITLE: Connect to Server ------------------------------ Cannot connect to C:Documents and SettingsdarrinbMy DocumentsVisual Studio 2008ProjectsTestSQLCompactEdition35TestSQLCompactEdition35AFS.sdf. ------------------------------
ADDITIONAL INFORMATION: Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
------------------------------ Could not load file or assembly 'Microsoft.SqlServerCe.Enumerator, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (mscorlib) ------------------------------ BUTTONS: OK ------------------------------
Hello, there are some limitations in SQL Server 2005 Mobile Edition - e.g. there is no TRUNCATE TABLE statement, the UPDATE .. FROM clause is not allowed etc. Are these limitations in Compact Edition too? Is T-SQL in these editions functionally equal or different? Is there any comparison of T-SQL features in both editions?
I'm currently looking at adding a database to my company's WinCE 4.2 -based device, running applications coded with embedded CE 4.0. We want to start tracking potentially large quantities of user data (10K-30K 500 byte records) and are looking at a database engine to support this. The database would reside on the device although we would potentially dump the data from the devices to a central workstation that would be used to pull reports about the data across multiple devices. SQL Server Compact Edition sounds like a possible solution, but I'm unclear if it's supported on CE 4.2 or how to install it if it is. It's clearly supported on CE 5.0, but it may be a while before we upgrade to CE 5.0 or 6.0. I've seen references that say that SQL Server Compact Edition is the same as SQL Server Mobile Edition, and references that Mobile Edition is supported on CE 4.2, but I'm unclear if I can install and use SQL Server Compact Edition on CE 4.2 or if I'm on a wild goose chase. If not, can I use SQL Server Mobile Edition and migrate to SQL Server Compact Edition when we upgrade CE to 5.0 or 6.0? If not Mobile Edition, what about Microsoft SQL Server CE 2.0? Is that going too far back in the archives? Thanks for any guidance/enlightenment you can offer.
Hi I am interested in taking MCTS exam 70-431 for sql server 2005 implementation and maintainance. I have been reading the hardware requirements for the instalation of sql server versions and realise that enterprise and developer editions have same minimum requirements for the operation system. I understand that the Developer Edition includes all the functionality of SQL Server 2005 Enterprise Edition, but it is licensed for use as a development and test system, not as a production server.
Also I undestand that the developer edition supports the Windows XP Home Edition with SP2 or later but the enterprise edition does not support this operating system. The evaluation/trial version is for the enterprise edition. Can I use the developer version of sql server 2005 for my practice exercises instead of using the trial version? I have all hardware requirements for the trial enterprise version except that I am using Microsoft windows Xp home edition version 2002 with SP2. I am trying to see if I can use the developer version of sql server 2005 as it is cheaper for me to buy this software than buying the new operating system for my computer. According to the microsoft book for the MCTS exam 70-431 there is a section which states that before you begin you should have Microsoft Windows Server 2003 running on your computer on an NTFS file system (NTFS) partition. Will I still be ok to use the book and be able to do all the tests in the book if i am using the developer version of sql server 2005 with my Microsoft windows Xp home edition than using the trial version which comes with the book?
I recently bought a Dell server with Windows 2003 enterprise edition. I wanted the X32 version and metnioned of the same to the sales people, but somehow they put the x64 edition on the server. The database I am planning to use does not work on X64 edition as of now. How do I downgrade the OS to X32 version? Do I need to send the system back to Dell? Machine not opened yet. Or is there a way I can get software CD and downgrade to X32 version?
I am trying to make a simple example like sql management studio but stuck in the get table names part :) in first step. are there any easy way to get just table names from sdf file ?
We have been using Sql Server 2005 Compact Edition 3.1 RDA synchronization method successfully on Sql Server 2000 database. Recently we moved the database to Sql Server 2005, sync doesn't work anymore, it just hangs on one table. On further investigation, we found out that it's the index on that table that causes this. We removed the index, it works fine. We are wondering the root cause, removing the index is not a solution for us. Any thoughts?. Thanks.
I work with a Development board with an armv4 processor for a Windows CE 6.0 application and tried to install there an SQL Server Compact. But it doesn't work. My information from Google and other sites is that the Compact edition of SQL server does not work on a Win CE 6.0 platform.
Does someone can give me to this subject further information€™s? Is there an alternative?
I am writing an application that is designed for the desktop, or small group (3 or less) desktops. The application is being deployed using the Cassini web server as a complete "embedded" solution. I wanted to use SQL Server Compact because of its small footprint and because of the synchronization capabilities with SQLServer. Also, it is very easy to deploy vs. SQL Server Express. The idea behind this APP is that someone might use it locally and then decide to subscribe to the service and then connect the same application to a web services application. That being said, and with knowledge of Microsoft's stance on SQL Compact under ASP.NET, I have most everything working and it works great except for one thing. When I add a SQLDataSource to the page and set the connection string to my file and the DataProvider to System.Data.SqlServerCe and then bind a data grid to the SQLDataSource, it runs fine on my development machine, but when I deploy to my clean test machine, I get an error when the page loads saying: Unable to find the requested .Net Framework Data Provider. It may not be installed. I can create a dataset in code (in fact,in several other places I do) and it works fine. It is just the SQLDataSource(s) that are throwing this error. I have a copy of System.Data.SqlServerCe.dll in the bin folder and I have all of the compact DLL's in the bin folder as well. I can't figure out what I need to do. I also have a reference to the System.Data.SqlServerCe in the web.config file. Can anyone help?
I am using SQL Server Compact Edition under ASP.NET. I am aware of the limitations and warnings from Microsoft for SSCE under ASP.NET, but this app is designed as a desktop deployed ASP.NET application running under the Cassini web browser. I wanted to use SQL Server Compact because of the RDA capabilities with SQL Server without the overhead of installing SQL Server Express. There would be 1-3 users at most running the application. SSCE seemed to make the most sense.
That being said, I have everything working fine except for this. I have added several SQLDataSource controls to several web forms and then I have GridViews bound to these controls. I like using the controls because of the built in sorting, grouping and updating I can do. When I run this on my development machine, it runs fine. When I move to one of my clean test machines and install the app, the SQLDataSouce controls throw the following error:
Unable to find the requested .Net Framework Data Provider. It may not be installed
I have the System.Data.SqlServerCe.dll in the bin folder along with all of the files from the the SQLServer Compact 3.1 install, a reference to it in the web.config file etc. In fact, I have several other database related datasets and tableadapters that are created throughout the application and they all work fine and can access and display data from my sdf file. It seems to only be with the SQLDataSource controls.
I'm trying to start an application in C# with visual Studio 2008 and I want to connect it to a SQL CE 3.5 Database (local .sdf file). I only found samples or How-to guides that use the wizard to add the datasource and the way dragging the dataset to the form. All things binded to the database where you don't have to do coding.
I don't want to have the binding navigator bar, I just want to use text box, date picker and buttons and Save that to the database myself. That way I think it will be more easy for me to validate or manipulate data before the insertion in the DB.
Some time ago a make an ASP.net that was doing same kind of thing with an Access DB... Hope this can help to show what i really want... (sorry for my bad english....)
Nick
Code Snippet Private Sub btnAskSql_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAskSql.Click lblMsg.Text = "" Dim MyDS As New DataSet
'txtRequest.Text is a SQL command like Select * from..... MyDS = SQLRequest(txtRequest.Text) Try DG01.DataSource = MyDS.Tables(0).DefaultView DG01.DataKeyField = "ID" DG01.DataBind() Catch ex As Exception lblMsg.Text = Err.Description Finally End Try End Sub
Function SQLRequest(ByVal TheRequest As String) As DataSet Dim _Con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" & Server.MapPath("Gifts.mdb") & ";") Dim selectCMD As OleDbCommand = New OleDbCommand(TheRequest, _Con) selectCMD.CommandTimeout = 30 Dim custDA As OleDbDataAdapter = New OleDbDataAdapter custDA.SelectCommand = selectCMD
Dim TheDS1 As New DataSet Try custDA.Fill(TheDS1, "Request") Catch ex As Exception 'oups lblMsg.Text = Err.Description Finally _Con.Close() End Try Return TheDS1 End Function
We are developing a desktop windows forms app that uses tha database as storage for application configuration. It may be used by one user locally OR used locally by multiple but sharing the database.
Now, i'm really sure that I have read that sharing the .sdf file over a network is supported and thus have started developing against the 3.5 compact db (sdf file). But when testing this scenario we get a message that sharing over network is not supported. I'm really surprised and frankly puzzled since I know I have read about this being supported.
So, can someone more into this subject exlpain to this to me? Is it supported, and if not, should we use the express version instead?
Also, if we have to change strategy, is there an easy migration path regarding development (app. is not even in beta stage so no migrations will be necessary with customers.).
Thankful for any help since this might cause a lot of extra work...
If this leads down the synchronization path, could someone please explain how this is set up. Is it one "master" that acts as a publisher? If we would like to have the solution where several users access the same db-file (be it sdf or mdf), do we have any choice here?