sql-server-ce

Unit testing with Effort and SQL CE in parallel fails

二次信任 提交于 2020-01-12 14:36:30
问题 I'm evaluating unit tests using EF6 in combination with http://effort.codeplex.com/ and SQL CE Server (Local DB file) http://www.codeproject.com/Articles/460175/Two-strategies-for-testing-Entity-Framework-Effort was a quite good reference but now I'm stuck. I have 2 test projects (one for Effort and the other for SQL CE). If I'm running both separately everthing's fine. Running both in a row with the ReSharper test runner the last test project always fails. Either System

Unit testing with Effort and SQL CE in parallel fails

孤人 提交于 2020-01-12 14:36:06
问题 I'm evaluating unit tests using EF6 in combination with http://effort.codeplex.com/ and SQL CE Server (Local DB file) http://www.codeproject.com/Articles/460175/Two-strategies-for-testing-Entity-Framework-Effort was a quite good reference but now I'm stuck. I have 2 test projects (one for Effort and the other for SQL CE). If I'm running both separately everthing's fine. Running both in a row with the ReSharper test runner the last test project always fails. Either System

Unit testing with Effort and SQL CE in parallel fails

女生的网名这么多〃 提交于 2020-01-12 14:36:03
问题 I'm evaluating unit tests using EF6 in combination with http://effort.codeplex.com/ and SQL CE Server (Local DB file) http://www.codeproject.com/Articles/460175/Two-strategies-for-testing-Entity-Framework-Effort was a quite good reference but now I'm stuck. I have 2 test projects (one for Effort and the other for SQL CE). If I'm running both separately everthing's fine. Running both in a row with the ReSharper test runner the last test project always fails. Either System

A sample configuration for nlog and SQL Server Compact 4.0

被刻印的时光 ゝ 提交于 2020-01-12 03:21:22
问题 I would be grateful if someone could post me a sample nlog.config for using nlog with SQL Server Compact 4.0. I can output to the console and a file OK. I've tried various dbProviders and connectionStrings, but nothing seems to work. Thanks in advance. Alan T 回答1: I figured it out. My test application is a console application written in C#. Below is the contents of the various files I used. Program.cs using NLog; namespace ConsoleApplication2 { class Program { private static readonly Logger

SQL Joining by field that *may* be empty

人走茶凉 提交于 2020-01-11 11:08:10
问题 In my SQL CE database I have three tables: customer , list and customerlist (a junction table between customer and list - as it is a many-to-many relationship). I am trying to run a query that will display all current lists with also the number of customers who are currently subscribed to that list (counting from customerlist table). Here is my current query: select list.listid, count(customerlist.customerid) as numppl, list.ShortDesc from list inner join customerlist on list.listid

Connecting C# to SQL Server Compact database

若如初见. 提交于 2020-01-11 09:25:13
问题 Hi I'm trying to connect an SQL server compact database to my program and I want a button that deletes all entries from the database, when I Press said button the program throws an exception and gives the following error message "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL

Entity Framework Code First Migrations failing on Wrong Provider (3.5 instead of 4.0)

大城市里の小女人 提交于 2020-01-11 07:23:06
问题 I am trying to add a migration (for the first time) to a project using Entity Framework 6.0.2 for SQL Server Compact (code first). The application is having no problems communicating with the database. The migration is failing with the error message: System.InvalidOperationException: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.3.5'. Make sure the provider is registered in the 'entityFramework' section of the application config file.

Reseed identity column in SQL Compact

纵然是瞬间 提交于 2020-01-10 19:42:30
问题 Is it possible to reset the identity column in a compact database? I'm finding lots of answers regarding standard SQL Server, but no definitive answer regarding if it is possible using SQL CE. Dropping and recreating the table is not ideal in my scenario! Thanks! 回答1: ALTER TABLE [MyTable] ALTER COLUMN [Id] IDENTITY (1,1) 来源: https://stackoverflow.com/questions/15271143/reseed-identity-column-in-sql-compact

How can I upgrade my Sql Server CE 3.5 sdf database to Sql Server CE 4.0?

戏子无情 提交于 2020-01-10 07:51:22
问题 I need to update my SqlCE3.5 database to 4.0. I get the following error message when I'm trying to access my 3.5 sdf/database using the new CE4.0 connection provide :- System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlServerCe.SqlCeInvalidDatabaseFormatException: The database file has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method . Anyone know how I can do this? Obviously I need to do it

Check SQL Server CE database after INSERTION for application evaluation

馋奶兔 提交于 2020-01-10 05:59:05
问题 I have the following script for insertion into a SQL Server CE database SqlCeConnection Con = new SqlCeConnection(); Con.ConnectionString = (@"Data Source=|DataDirectory|\Database.sdf;Password=Password;"); Con.Open(); SqlCeCommand Query = new SqlCeCommand("INSERT INTO Users(ID,Name,FName,Address,MCode,MNum,Amount) VALUES(@ID,@Name,@FName,@Address,@Code,@Num,@Amount)", Con) Query.Parameters.AddWithValue("@ID", ID + 1); Query.Parameters.AddWithValue("@Name", NBox.Text); Query.Parameters