sql-server-ce

Using LINQPad to insert data into a SQL CE Database, Linq-to-sql, gets slower over time, anything I can do about it?

烈酒焚心 提交于 2019-12-08 00:15:24
问题 I have a SQL CE 4.0 database on disk, and a LINQPad program that I wanted to use to fill that database. I am using the built-in (to LINQPad) linq2sql system. I am noticing that as time goes on, the time it takes to insert a batch of rows takes more and more time and eventually it looks like the program has slowed to a crawl. Is there some kind of caching or similar that is slowing it down? What, if anything, can I do to avoid this slow-down? Here's my simple test-table that I used to test

SQL Server Compact Edition with Entity Framework

拥有回忆 提交于 2019-12-07 21:03:06
问题 I try to use SQL Server Compact Edition with Entity Framework in Visual Studio 2008 SP1. Here's what I do: 1) I create a new project, of type Console Application. 2) I right-click on the project, select Add->New Item. 3) I choose to add a Local Database called Something.sdf 4) In the next page of the "Add New Item" wizard, I choose the default dataset name (SomethingDataSet) Now, in the Server Explorer, the new database Something.sdf is shown under Data Connections. 5) I right click on the

How can I check whether a table exists in SQL Server CE 3.5

孤街浪徒 提交于 2019-12-07 20:30:13
问题 I have a database user.sdf in asp.net, I want to create the tables for that I need check it check it first exist are not if exist then need not create the tables, else create the new table how can I check it that please help me to resolve this. 回答1: You can query the schema views in SQL CE 3.5 take a look here. Here is a simple extension method that you could use. public static class SqlCeExtentions { public static bool TableExists(this SqlCeConnection connection, string tableName) { if

How to deploy ASP.NET MVC4 application with SQL Server CE to Azure website

こ雲淡風輕ζ 提交于 2019-12-07 19:07:27
问题 I deployed a ASP.NET MVC4 app with SQL Server CE database, but I'm getting Sorry, an error occurred while processing your request I am using VS2012 to publish this app to azure website. How can I solve this issue? Thanks. 回答1: To summarize and so an answer can get marked on this to help the next person that comes by. When running into issues on azure-web-sites FTP is a handy debugging tool which enables you to: Verify that the dll exists in your bin directory Sometimes the .gitignore file

Generating Entity Keys

邮差的信 提交于 2019-12-07 18:19:52
问题 I have run into my first dissapointment with Entity Framework 4. It turns out that SQL CE, when used with EF4, does not support autogenerated primary keys. I get a System.Data.UpdateException from OnjectContext.SaveChanges() with this message: Server-generated keys and server-generated values are not supported by SQL Server Compact. So, now I have to manually generate keys for my entities. Assuming I want to use auto-incremented integer keys, what is the best way to go about generating and

SQL Server CE - ROW_NUMBER

こ雲淡風輕ζ 提交于 2019-12-07 16:26:12
问题 I don't know what is wrong with this code, it's giving me error for a day now: select row_number() over(order by s.title) as rowNumber, s.id from story as s Table Definition: id bigint title nvarchar(100) content ntext Database: SQL Server Compact 4.0.8482.1 Error: There was an error parsing the query. [ Token line number = 1,Token line offset = 22,Token in error = over ] WHAT I DID SO FAR: I've searched here in SO for same problem but the solution is not applicable to mine, I need row_number

Nested SELECT clause in SQL Compact 3.5

爷,独闯天下 提交于 2019-12-07 13:11:14
问题 In this post "select with nested select" I read that SQL Compact 3.5 (SP1) support nested SELECT clause. But my request not work: t1 - table 1 t2 - table 2 c1, c2 = columns select t1.c1, t1.c2, (select count(t2.c1) from t2 where t2.id = t1.id) as count_t from t1 Does SQL Compact 3.5 SP1 support nested SELECT clause in this case? Update: SQL Compact 3.5 SP1 work with this type of nested request: SELECT ... from ... where .. IN (SELECT ...) SELECT ... from (SELECT ...) 回答1: Thank all for help

Retrieve ODBC table and Insert into SQL Server CE database

僤鯓⒐⒋嵵緔 提交于 2019-12-07 12:25:51
问题 I have an ODBC connection to a database of which I need one table of data. The table has about 20 rows, and a couple thousand lines of data. I intend to insert this table into my local SQL Server CE database, where I can put it to further use. Both connections have been tested and work. My attempt was at just inserting one column to keep things simple (I'm new to C#, programming, and stackoverflow). OdbcConnection c = new OdbcConnection(ConnectionString1); SqlCeConnection d = new

Designing data access for Compact Framework and Full Framework

安稳与你 提交于 2019-12-07 10:42:30
问题 We currently have a desktop app which uses data from SQL CE. We used Entity Framework for our ORM layer to the database and all data access methods are built around this. Now we have to build a smaller scaled down "clone" of this app for Windows CE 6.0 on the Compact Framework, also using the same SQL CE database design as on the desktop version. The problem is that compact framework does not support Entity Framework, so we are forced to access the database the old fashioned way (ADO.net,

EF & WCF error - SQL Server Compact is not intended for ASP.NET development

徘徊边缘 提交于 2019-12-07 09:35:48
问题 Hi I have a simple wpf app setup to consume my test wcf service running in another project. The service retrieves a few rows from a sql compact 3.5 sdf attached to the wcf service project using Entity Framework. Im getting the "SQL Server Compact is not intended for ASP.NET development." error on the 1st line of the of my object context class in the service project as soon as I try and run one of the services. This error supposedly can be suppressed with "AppDomain.CurrentDomain.SetData(