sql-server-ce

Local database inserts not being stored

前提是你 提交于 2019-12-02 04:28:25
问题 This is probably a stupid mistake of me.. but I can't seem to understand it. I've created a new, empty C# Windows Forms application. I added a Database (Based on a dataset) and have the file stored in my solution explorer. I've added a table Test with column Name . I add a record using new SqlCeCommand("insert into Test values('Name')", new SqlCeConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)).ExecuteNonQuery(); However, I've even tried retrieving the

How can I query a MS SQL Compact Server 3.5 database in C++ not using the OLE DB API?

♀尐吖头ヾ 提交于 2019-12-02 01:48:07
I have the dlls and the include files of MS SQL Compact Server 3.5. How can I use it without OLE DB? I just want to load the dlls and invoke the necessary methods myself, no COM please. Does anyone know the API? EDIT If this is not possible is there a fully functional example in C++ demonstrating accessing a database using the MSSQL Compact Server edition? I do not think that is possible - http://msdn.microsoft.com/en-US/library/ms174579(v=SQL.90).aspx - an OLEDB sample is available here: http://archive.msdn.microsoft.com/sqlce/Release/ProjectReleases.aspx?ReleaseId=3808 Stephen Quan I just

UPDATE on two INNER JOINed tables in SQL Server Compact 4

被刻印的时光 ゝ 提交于 2019-12-02 00:27:00
问题 I'm trying to update values between two tables in sql server compact edition 4.0. My sql is like below: UPDATE ei SET ei.EstateID=e.EstateID FROM EstateImages ei INNER JOIN Estates e ON e.TempKey=ei.TempKey Also tried this: UPDATE EstateImages SET EstateID = (SELECT EstateID FROM Estates WHERE TempKey = EstateImages.TempKey) I'm having error: There was an error parsing the query. [ Token line number = 1, Token line offset = 37, Token error = SELECT ] 回答1: If you check Books Online or other

Getting file version info in the Compact Framework

旧街凉风 提交于 2019-12-02 00:05:30
问题 I have some code that needs to be able to find the version number of an assembly, given a string saying where it's located. I can't get this to work: Assembly assembly = Assembly.LoadFrom("\\Program Files\\Microsoft SQL Server Compact Edition\\v3.5\\sqlcecompact35.dll"); throws a System.IO.IOException: File or assembly name '\Program Files\Microsoft SQL Server Compact Edition\v3.5\sqlcecompact35.dll', or one of its dependencies, was not found. Yet the file does exist: FileInfo fileInfo = new

SQL Server Compact Edition and reporting. Is SSRS an option?

无人久伴 提交于 2019-12-01 23:43:46
I need to create a simple, stand-alone application that will allow for users to input some data and then print a report. I would prefer to use SSRS as a reporting engine but I also want to keep my data store very simple. I have another, sizable smart-client application that uses SQL Server Express edition as a user back-end. From experience, SQL Server Express is certainly an option, however, integrating a database creation and maintenance process is a bit of a nightmare, due to various end-user constraints. SQL Server CE is much easier to use for my needs, if that is an option. Can I use SQL

Why are my LINQ INSERTS not persisting in SQL Server CE 3.5?

百般思念 提交于 2019-12-01 23:12:26
问题 I am using LINQ to SQL with Sql Server Compact Edition 3.5 and VS2008. I have a very simple table (Tokens) with a uniqueidentifier primary key (TokenID) and two other nullable fields (UsedBy and UsedOn). I am trying to use LINQ to insert new rows into the table but for some reason they are not persisting. Here is my code: var connectionstring = "Data Source=|DataDirectory|\\MyData.sdf"; MyData db = new MyData(connectionstring) { Log = Console.Out }; Tokens token = new Tokens { TokenID = Guid

Getting file version info in the Compact Framework

扶醉桌前 提交于 2019-12-01 21:18:32
I have some code that needs to be able to find the version number of an assembly, given a string saying where it's located. I can't get this to work: Assembly assembly = Assembly.LoadFrom("\\Program Files\\Microsoft SQL Server Compact Edition\\v3.5\\sqlcecompact35.dll"); throws a System.IO.IOException: File or assembly name '\Program Files\Microsoft SQL Server Compact Edition\v3.5\sqlcecompact35.dll', or one of its dependencies, was not found. Yet the file does exist: FileInfo fileInfo = new FileInfo("\\Program Files\\Microsoft SQL Server Compact Edition\\v3.5\\sqlcecompact35.dll"); creates an

Update LinqtoSql database with new schema changes?

不打扰是莪最后的温柔 提交于 2019-12-01 21:14:04
问题 I have a Windows Phone 7 application that has been published to the marketplace. I'm using Sql CE with LinqToSql. When the app runs, it checks for the existence of a database from a connection string, and creates if it doesn't exist. using (CheckbookDataContext db = new CheckbookDataContext(DBConnectionString)) { if (!db.DatabaseExists()) { isNewLoad = true; db.CreateDatabase(); } } As I begin to plan new features, I foresee some changes to the database schema, whether it be adding a new

Connecting to a SQL Server Compact Edition (.sdf) from an MFC application

十年热恋 提交于 2019-12-01 21:04:05
I'm building an MFC app in Visual Studio 2008 which classifies textures and I need some sort of lightweight database to hold the characteristics (just some doubles and strings) which can be: Carried around with the app on different computers Be able to perform queries on it from the app (searches , updates ,inserts ,etc) Currently I'm looking into SQL Server Compact Edition because it was very easy to create from Visual Studio (I also need only one table). But I;m having a hard time connecting and updating the database from C++. This is what I've found on MSDN regarding C++ and SQLCE: public:

Sorting Alphanumeric field in SQL CE (Compact Edition) version 3.5

我只是一个虾纸丫 提交于 2019-12-01 20:36:56
Sorting Alphanumeric field in SQL CE (Compact Edition) version 3.5 TreeNumber is a nvarchar field with a mix of numbers and strings for the values. I want to sort these records so that the records that contain alpha characters are at the top and the rest are sorted in numeric order. I want something similar to the following query which works in SQL Server: SELECT * FROM Tree ORDER BY (CASE WHEN TreeNumber LIKE '%[a-z]%' THEN 0 ELSE TreeNumber END), TreeNumber The above query doesn't seem to work because the [] range is not supported in CE. Another solution which works with SQL Server but doesn