sql-server-ce

Combobox and System.Data.DataRowView

狂风中的少年 提交于 2019-12-13 02:25:32
问题 I have a method that is called when the main form is opened private void populateComboBoxes() { SqlCeDataAdapter breakfastAdapter = new SqlCeDataAdapter("SELECT DISTINCT recipeName FROM Recipe WHERE Category = 'breakfast' ", databaseConnection); SqlCeDataAdapter lunchAdapter = new SqlCeDataAdapter("SELECT DISTINCT recipeName FROM Recipe WHERE Category = 'lunch' ", databaseConnection); breakfastAdapter.Fill(breakfastDS, "Recipe"); lunchAdapter.Fill(lunchDS, "Recipe"); cmbBox1.DisplayMember =

Sql Compact decimal precision error

人走茶凉 提交于 2019-12-13 01:15:27
问题 I have a Windows Phone app using Linq to Sql with Sql Compact. My Item table has a wide variety of field types, including some decimal and nullable decimal values. When testing in the emulator, at startup and reading the Item table in a background thread to populate into a ListBox on the main page, I'll get an unhandled ArgumentException: Precision value '29' is either less than 0 or greater than the maximum allowed precision of 38. This is intermittent, perhaps once out of every 15 to 20

Entity Framework & SQL Compact Edition - how do I get ntext?

ε祈祈猫儿з 提交于 2019-12-12 23:05:17
问题 The answer to my question should be quite obvious, but I cannot find it. I have a edmx file that has one table. There is a field of type string . EF always generates nvarchar for that (which is kind of expected), but I need an ntext instead of nvarchar for that field as 4000 is too small for me. So tell me - what is the proper way to tell EF to generate ntext fields? PS Using Entity Framework 4, SQL CE 3.5 回答1: I guess you are using model first, don't you? You can simply create custom T4

Does SQL CE 4 (CTP) support ambient transactions using System.Transaction namespace?

半城伤御伤魂 提交于 2019-12-12 21:05:55
问题 From what I can see the .NET drivers for SQL CE 3.5 and below do not support System.Transactions. Has this changed for the new version of SQLCE (version 4)? 回答1: No, no changes there... http://msdn.microsoft.com/en-us/library/bb896149.aspx 来源: https://stackoverflow.com/questions/3401796/does-sql-ce-4-ctp-support-ambient-transactions-using-system-transaction-namesp

SQL Compact Database larger than configured size

旧时模样 提交于 2019-12-12 20:09:34
问题 I'm trying to search a mobile SDF database in Windows Mobile 6.1 and the database is about 270MB. Whenever the program tries to read from the database I get this error: "The database file is larger than the configured size. This settings takes effect on the first concurrent database connection only [Required Max Database Size (in MB; 0 if unknown) =0]" I tried specifying the size in the connection string but I get an error as well: public bool ConnectDB(string strDB, string strPassword) { try

Performance in SQL Mobile with one big column that's not being selected

大城市里の小女人 提交于 2019-12-12 18:21:38
问题 I have a SQL Mobile database with one table. It has several columns with useful, often queried data and one column that stores a relatively large string per record (1000+ characters) that is not queried often. Imagine this fake schema, the "lifeStory" field is the large one. table1 String firstName String lastName String address String lifeStory A representative query would be SELECT firstName, lastName, address FROM table1 WHERE firstName = :p1 Does anyone know of any performance concerns

SQL CE 4 System.Transaction support

跟風遠走 提交于 2019-12-12 16:57:21
问题 A similar question was asked here but had no answer. I am attempting to use a System.Transactions.CommittableTransaction with EF CTP4 and SQL CE 4. I have created the following transaction attribute for my ASP.NET MVC Controller actions: public class TransactionAttribute : ActionFilterAttribute { CommittableTransaction transaction; public override void OnActionExecuting(ActionExecutingContext filterContext) { transaction = new CommittableTransaction(); Transaction.Current = transaction; base

How can I see the SQL sent to the database after the parameters have replaced their placeholders?

99封情书 提交于 2019-12-12 16:18:20
问题 The first MessageBox.Show() below simply shows me the exact same thing as const string SQL_GET_VENDOR_ITEMS, which seems fine to me, but I'm getting, " There was an error parsing the query. [Token line number, Token line offset,, Token in error,,] " Is there a way to spy on the contents of the SQL after parameters have been added; it should then be something like: "SELECT ItemID, PackSize FROM VendorItems WHERE VendorID = 'TEST' AND VendorItemID = '852963' Here's the pertinent code: const

Can I use osql with Sql server Compact Edition

时间秒杀一切 提交于 2019-12-12 14:34:50
问题 I have a file that contains lots of insert statements to populate my compact edition database with test data. I have been running the file from Sql Server Management Studio each time I run a unit test (I'm using NUnit). Now I want to automate the running of database scripts for each test. I'm trying to use osql as described in this article: Unit testing the data layer The problem is that I don't know how to connect to an sdf file using osql. I have 2 problems, First I don't have a User Id for

The Ntext And Image Data Types Cannot Be Used In WHERE, HAVING, GROUP BY, ON, Or IN Clauses

和自甴很熟 提交于 2019-12-12 14:34:06
问题 I am getting an error: The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates while trying to save the changes to SQLCE tables. Please note this is an update operation. I have version 3.5.1.0 of SQLCE installed. Below is the error message and stack trace with the code: System.Data.SqlServerCe.SqlCeException was unhandled Message=The ntext and image data types cannot be used in WHERE