I am using Visual Studio 2005 (with the Windows Mobile extensions); SQL Compact. This is on a Vista machine. I am new to this environment.
-- I am struggling with the interface to SQL Compact from within VS 2005 (VB code). Specifically, if I try to run a "CREAT TABLE ...." command from code it appears to complete, but the table is not created.
I am using a sample create table SQL statement from a Microsoft web page:
I am new to SQL programming, i have only a fair knowledge on sql programmin.So, I apologies for any silly questions-
I have a Table1 which contains C1-acountid C2-date C3-grossamount(postivie and negative decimal values) C4-netamount
Table2 C1-groupid C2-accountid
Table 3 C1-groupid C2-groupname
I need to create a store procedure to retrieve the following on a single table
1. top 10 losers of the day i.e. 10 AccountIDs with the greatest negative Grossamount for the day NOTE:These 10 AccountIDs may be sam or differing each day 2.sum of Netamount for each AccountIDs listed in STEP 1 since the beginning of the month. NOTE:These 10 AccountIDs may be same or differing each day and each day sum of netamount should be from beginning of the month till current date. 3.Sum of Netamount for the last 5 days for each accountids in STEP1
The result set must contain the columns as below
C1-accountid C2-date C3-net loss for 10 losers on the current date since the beginning of the month C4-Sum of Net for last 5 days C5-groupname
Please help me.
Below is the script that i have written, without calculating the sum
( select top 10 a.date, a.accountid, a.gross, a.net, c.groupname from GBSys_Sum_EOD a
join server2.dbname.dbo.table2 b on a.accontid=b.accounit=id join server2.dbname.dbo.Table3 c on b.groupid=c.groupid
where date> getdate()-1 and gross< (floor(-00.00)) order by gross )
I'm trying to run a query on a SQL Server 2005 table which has a WHERE clause that requires a query from my SQL Compact table.
SELECT * from RemoteDB.TESTDB.dbo.Objects
WHERE Last_Updated > '2008-05-21 10:51:00'
AND Object_PARENT IN (select Object_CODE from LocalDB.PDADB.dbo.Objects)
Basicallly on a linked system, this query would find all new objects in my main database where the same objects exist in my local database. This would work just perfectly, no problems.
Now, the local database is actually on a PDA running SQL Server Compact Edition. There is currently no support for creating a linked environment. I have the option of pulling the table off the local db and pushing it to the remote db and then running the above query from within the single db and then retrieving the list of new entries and pulling them down to the local db but that is a HUGE amount of bandwidth, even if I just used the single primary key column.
Would anyone maybe have a little advice for me on how I could possibly achieve the above result on SQL Server Compact please?
New to SQL Server Compact Edition and I am getting my feet wet with the following tutorial: http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060831MobileRB/manifest.xml
I follow the tutorial exactly, but the data I edit through the Edit Dialog Form is not saved to the SQL Server table even though all of the edits appear in the datagrid. They never make it back into the table.
After deleting all the test data from all tables in a SQL 2000 database, is there a way to reset all the auto-incrementing fields back to zero in one shot? In Access, you can run the Compact and Repair option. Also, in Sybase SQL, there was an "unload/reload" option to reduce the database size. Is there a similar function in SQL2000? Thanks for all the help
End Sub this code worked well. we know sql7 is not compatiable with vista. please tell us how to connect it wiith sql2005 . we downloaded orcas express edition beta. we created a database also. please let u know how to connect with Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5).
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.
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 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.
No one answered in another group, please help.Using access 2000 /msdeI know how to compact the access project file (.adp), there's a menu choicefor that.How do I compact the tables and stored procedures on the server? ( The .MDFfile)I only have the DOS promp OSQL utility to work with.thanks
I'm trying to add an SQL Compact Edition database to my application running on a CE 6.0 platform that I am also developing. Unlike PB 5.0, I don't see sql CE listed as an option in the catalog and when I try to run my application I get a pInvoke sqlceme30.dll error. I have found a number of references to this same issue elsewhere but no real good solutions. Most seem to point to the cab files not being deployed. I am thinking that I should have the necessary support files deployed in the CE image and I have downloaded and installed every sql CE version/update that I can find but none of them seem to add support to PB 6.0.
I am trying to add the cab files manually but I would appreciate any suggestions if there is a better solution............ Thanks
Is SQL Server Compact Editon 3.1 supported on Windows CE 6.0?
When I install the cab file sqlce30.wce5.armv4i.CAB in CE 6.0 it says that it might not be compatible. If I continue anyway it seems to work fine, but only the first time the application starts and accesses the database. When restaring the application it fails to connect to the database until I have reinstalled the cab file.
I have an application where I need a desktop Application to manage the data and I have PDA application which talks to RFID and gathers the data. I am a bit confused if i can have only one database which can work both on PDA and Desktop. Can you please help me decide if i should use compact or express for this purpose. Also I might have to use both compact and Express but is there a way to have common database for both where they can be replication and easily synchronised.
Hi, I am wondering why a database that was 2Gb in size would come down to just 300Mb when I copy all the data from the origional database into a blank new one. I ran a database shrink on the origional database but that only reduced it from 2.1 Gb to 2Gb. I was shocked to see the size difference when I copied the data. As far as I can tell the copied database still contains all the records of the origional.
I remember that MSAccess had a Compact function that literally copied all the data from one databse into a new empty one - is there the equivalent for SQL?
Hi,I just deleted about 1 million records from a SQL Server 2000 database. Iaccess it using Access 2000.I have Compact and Repair available in the adp under Tools. Should I do thatfrom Access? Will it not mess anything up?Thanks!J~
Can SQL Server Compact Edition do RDA with SQL Express? or I need to have SQL Server 2005(standard) instead of SQL Express? I will use RDA to synchronize the Compact Edition database on the phone and SQL Server database on desktop.
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 ?
I have VS2008 (9.0.21022.8 RTM) and I cannot get SQL Compact 3.5 to work with it. Whenever I attempt to open a compact edition database, I get a message that "The operation cannot complete, click OK on the "Package Load Failure" dialog, reinstall SQL Server Compact 3.5 and then from the command line run devenv /resetskippkgs. I've tried that twice and no joy. I can connect and work just fine with SSMS 2005, but I cannot get it to work in VS2008.
Also when in VS2008 and I go to Server Explorer | Data Connections | Add Connection, I do not have Microsoft SQL Server Compact 3.5 in the list.
I've downloaded and installed SQL Compact Edition. When I go to Access to set up a project (or to use the upsizing wizard) the software doesn't see the Server on my computer. No doubt I'm missing some very simple step. Although the compact server is installed, there's no program file to run, so I don't see how to get into the server software in order to set up a database or project that I can link to from Access.
I've also downloaded and installed Microsoft.net. As with server, the files are in place but there's no program file to execute.
I am trying to make an asp.net application that will run from the SQL Compact database.
To deploy the application we changed from a full path Data Source="C:inetpubappasdf.sdf" to Data Source="|DataDirectory|asdf.sdf"
This returns: Illegal Character in Path
So I switched to having VS make the path for me Data Source=".App_Dataasdf.sdf" and got The path is not valid. Check the directory for the database. [ Path = .App_DataPDQ_Test_CE.sdf
Is there ANYWAY to use a relative path for the SQL Compact Connection string?
What I need is to make sure that in case if my Windows CE based device lost power supply my SQL Compact 3.5 database will not be corrupted and I can read data from it. Has anybody any experience in this area?
This is critical requirement for our project and I want to know it is feasible or not.
I have problems in migrating. Here are the questions: 1. Is the ShrinkDatabase task the SSIS equivalent of this script? If so, I'm having problems creating a new connection since it is an mdb file stored on local computer and not on a server. Is there a workaround on this? 2. If I have to use the script task, I use this codes:
Set Engine = CreateObject("DAO.DBEngine.35") Engine.CompactDatabase "C:.path...database_UnCompress.mdb", "C:path... estdatabase.mdb" or
Set Engine = CreateObject("JRO.JetEngine") Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathdatabase.mdb", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathcompacted_database.mdb" Both produce the same error: Option Strict On disallows late binding. Any suggestions?
3. I also tried to use the Execute SQL Task, using dbcc shrinkdatabase. But I seem lost again in creating a connection. Should I consider "database_UnCompress.mdb" as flat file source?
We are replicating SQL Server Compact and SQL Server 2008. My understanding is that SQL Server 2008 can only replicate with Compact 3.5 SP1, not Compact 3.5.
I have not been able to locate a download fromMicrosoft for SQL Compact 3.5 SP1. The download that is available is for Compact 3.5 (without the SP1).
Does anyone know where I can get the SP1 download?
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?
Hi, We have just installed visual studio 2008 for a windows mobile application development. This application requires a database also. VS 2008 installs sql server 2005 express edition and the sql server compact edition 3.5. We installed sql server management studio but this is for the express edition only. Please let us know how to use a similar tool for compact edition, we could not find any suitable for the same. Regards
you can, with a dataset do something like myDataSet.WriteXml(m_XmlFile, XmlWriteMode.IgnoreSchema) and get XML for a record.... is it possible to do something like that with SQLserverCeresultset? i know i could probably loop thru the columns and create the xml manually... but using somethinglike writexml will give better performance? right now im not using anything from the XML class... from my previous exp with using XML classes on the Compact framework gives slow performance...
I'm an Access man moving towards SQL Server and I'm interested in knowing if there is a utility for my SQL Server version 7 database that is similar to Access' Compact and Repair utility? I'd like a recommendation from a guru on what Prevenatative Maintenance measures I should be running daily/weekly/monthly etc...
I want to access to a SQL Compact database with an application develope with Visual Basic ans using ADO (not ADO .Net). Is it possible and how ? Thank You.