sql-server-ce

How to connect to SQL Server Compact Edition 4.0 with a type provider in F#?

我与影子孤独终老i 提交于 2019-12-04 06:12:44
I'm attempting to connect to a SQL Server Compact Edition database from F#, and attempting to use a type provider. This is in the Visual Studio 11 Beta, so I realize there might be an issue because of that, but I think it's more likely that I just don't have the know-how yet. However, I have noticed that there's no CE-specific type provider in Microsoft.FSharp.Data.TypeProviders and I'm unsure that a regular SqlDataConnection will do the trick, so that may be the issue right there. However, when I try to create the connection, the IDE seems to recognize that I'm trying to hit a CE database, at

SQL Server Compact error: Unable to load DLL 'sqlceme35.dll'. The specified module could not be found

老子叫甜甜 提交于 2019-12-04 05:19:09
I'm developing a Windows Forms application using Visual Studio 2008 C# that uses an SQL Server Compact 3.5 database on the client. The client will most likely be 32 bit Windows XP or Windows Vista machines. I'm using a standard Windows Installer project that creates an MSI file and setup.exe to install the application on a client machine. I'm new to SQL Server Compact, so I haven't had to distribute a client database like this before now. When I run the setup.exe (on new Windows XP 32 bit with SP2 and Internet Explorer 7) it installs fine, but when I run the application I get this error:

Basic start with Visual Studio C# and SQL Compact (connect, select, insert)?

帅比萌擦擦* 提交于 2019-12-04 04:50:32
I'm trying to learn about C# with SQL CE so that my program can remember stuff. I have created a database and can connect to it: SqlCeConnection conn = new SqlCeConnection(@"Data Source=|DataDirectory|\dbJournal.sdf"); conn.Open(); And it connects right, I guess cause if I rename the dbJournal.sdf to something wrong it doesn't debug right. Let's say I want to make a simple SELECT query. (SELECT * FROM tblJournal) How is that done? What about a simple insert? (INSERT TO tblJournal (column1, column2, column2) VALUES (value1, value2, value3)) I'm used to PHP and MySQL (as you properly can see :o)

Advantages and Disadvantages of SQLite.NET and SQL Server Compact

♀尐吖头ヾ 提交于 2019-12-04 04:35:53
I have used SQLite.NET many times. It always worked fine but I have a friend that is really pestering me that I should use instead SQL Server Compact so I stayed fully in Microsoft environment. Now, I never worked with Compact, and he tells me it works fine for him, but seeing that .MDF extension gives me the creeps. No kidding. Last thing I want is my application relying on an Access database. Since I have never really worked with it, I am asking if someone here knows it to vouche for it, and if someone can tell me the main differences between them, mostly speed, file size, reliability, and

Cascade delete on many-to-many between same table

 ̄綄美尐妖づ 提交于 2019-12-04 04:16:05
I'm trying to create a many-to-many relation between the same table in SQL Server. I have one table Object with columns ObjectId and Name . The relation follows these rules: a child can have many parents a parent can have many children ObjectA can be a child of ObjectB and ObjectB can be a child of ObjectA but an object cannot be a direct child of itself So I create a second table ObjectRelation with columns ParentId and ChildId and of course I want these relations to be deleted by cascade. But when I try this in SQL Server I get the error Introducing FOREIGN KEY constraint 'FK_ObjectRelation

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

孤街浪徒 提交于 2019-12-04 03:46:25
问题 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

Why do I receive file share error if Sql Compact allows multiple connections?

淺唱寂寞╮ 提交于 2019-12-04 03:19:17
问题 Here, it is said that Sql Server Compact allows up to 256 connections. But when I try to open 2 connections, I receive a file sharing error. How can I solve this? SqlCeConnection c1 = new SqlCeConnection("Data Source=testDB.sdf;Encrypt Database=True;Password=test;File Mode=shared read;Persist Security Info=False;"); SqlCeConnection c2 = new SqlCeConnection("Data Source=testDB.sdf;Encrypt Database=True;Password=test;File Mode=shared read;Persist Security Info=False;"); c1.Open(); c2.Open(); //

Connecting to SQL CE db using SQLConnection

China☆狼群 提交于 2019-12-04 03:16:24
Pretty straightforward question. I'm building an app which reads data from a SQL Server 2005 instance. I wanted to run some tests on my laptop (which does not have SQL 2005) so I was looking at swapping in a local database for the purpose of the tests. I'm using VS2008 so the Compact Edition DB seemed a natural choice. I had hoped to just swap out my connection string, but it seems It will only let me connect to the CE database using the SqlCeConnection and not SqlConnection. Any way around this, modifiers I can use in the connection string perhaps? It's actually very possible to user SQL CE

relative path for database file in config file

限于喜欢 提交于 2019-12-04 02:50:15
I've created a WCF REST service that uses nhibernate to connect to sql server compact edition database. Hence I configure the NHibernate datasource like: <property name="connection.connection_string">Data Source=[Path]\MyDb.sdf</property> The annoyance I'm running into now is that I can't figure out how to avoid having to write out the absolute path in the config. This is annoying since I keep the database file as part of the project in the App_Data folder. So I shouldn't have to update the path e.g. when I deploy the project to another location, even if the absolute path is different. Using

How to use parameter with LIKE in Sql Server Compact Edition

折月煮酒 提交于 2019-12-04 01:50:34
I'm trying to parameterise a search query that uses the LIKE keyword with a wildcard. The original sql has dynamic sql like this: "AND JOB_POSTCODE LIKE '" + isPostCode + "%' " So I've tried this instead, but I get a FormatException: "AND JOB_POSTCODE LIKE @postcode + '%' " Edit: I guess the FormatException isn't going to be coming from Sql Server CE, so as requested, here is how I set the parameter in my C# code. The parameter is set in code like this: command.Parameters.Add("@postcode", SqlDbType.NVarChar).Value = isPostCode; I also tried: "AND JOB_POSTCODE LIKE @postcode" with command