sql-server-ce

Sql Server CE can I delete TOP or only 1 record from table that matches my query

≯℡__Kan透↙ 提交于 2019-12-08 08:45:28
问题 select Top(1)* from TableName Where columnName=value selects only the first row just fine. However if I change the select to a delete I get an error and can't figure out how to write a query to delete only 1 record that matches my query from the db. I'm wondering if anybody out there smarter than I knows if or how this can be done in SQL CE. 回答1: Did you try something like this? DELETE TableName where IdColumn In ( select Top(1) IdColumn from TableName Where columnName=valuev) 回答2: I don't

Do I need to install SQL Server Compact Edition on all client's desktops?

自作多情 提交于 2019-12-08 08:38:54
问题 I am developping a WPF desktop application, that I deliver to my users by a setup project with Visual Studio (2008, .Net 3.5). This application uses a local database, whose type is SQL Server Compact Edition 3.5. My question is : do the users have to install SQL Server Compact Edition in addition to my application, or ideally is it possible to deliver all required DLL for SQL Server Compact Edition with my application ? 回答1: Sql Server is not just a set of DLLs, but Microsoft makes it easy to

MVC Code First: App_Data Folder Not Being Created

﹥>﹥吖頭↗ 提交于 2019-12-08 07:14:43
问题 I'm using the MVC Code First approach to create a SQL Compact database (from WebConfig: data source=|DataDirectory|MailBoxDB.sdf). The .sdf file should get created automatically, and it does if I manually create the App_Data folder on the web server (Windows Server 2008). However, I'm trying to automate the deployment process and I want to eliminate this manual step. I'm using MSDeploy to create the deployment package. Is it a permissions issue that prevents IIS (7.5) from creating the App

How to set a relative path to a SQL Server Compact database?

对着背影说爱祢 提交于 2019-12-08 04:32:35
问题 How do I write the path to a compact database so it will work for everyone working on the project? My local path looks something like this: SqlCeConnection con = new SqlCeConnection(@"Data Source=C:\Users\Name\Documents\Visual Studio 2012\Projects\Unwanted\Local\Path\App_Data\Databas.sdf"); I think I've seen people use "~" sign to do stuff like this, anyhow I want to make this connection viable for everyone no matter how their mapping looks like. Hope I made myself clear! :) 回答1: The tilde (

Hosting site Asp.net MVC and SQL Server Compact 4

▼魔方 西西 提交于 2019-12-08 04:20:30
In my ISP, they must hire service SQL Server to host a sql server compact framework? The fact that MVC requires the host to have some extra service? Or a simple hosting plan already supports asp.net MVC? You can bin-deploy SQL CE 4. Just make sure you are using the RTM version because there was a problem with bin-deployment in betas. Also see Scott Gu's blog post about it. ASP.NET MVC 3 can also be bin-deployed if your hosting provider doesn't have the assemblies installed in the GAC. All that's need is .NET 4.0. This being said SQL CE is an embedded database and not designed to work in a

SQL Server CE extremely slow on some computers

心不动则不痛 提交于 2019-12-08 01:55:12
问题 I've built an app that uses SQL Server CE 4.0 by default, but can also use a separate SQL Server (SQL Server Express). I've deployed it to about 10 computers around the office and it works fine except on 2 of them: the VP and a QA guy, of course :-/ On these computers, the database accesses are taking around 30 seconds each! If I install SQL Server Express 2008 R2, and tell my app to use it instead, then it runs very fast. Both problem machines are WinXP SP3, but most of the working PCs are

Windows Phone 7 databases

佐手、 提交于 2019-12-08 01:30:22
问题 i am new to windows phone 7 and im just looking for some information in regards to databases. I understand that we can use SQLce to store a database, i've got some idea on how to create one, at the moment i was wondering how to have prepopulated data when a app is loaded?, ive heard about sqlmetal is that a way of creating a database and addinbf data? Also When i have a database on a mircosoft sql server, is it possible for SQLce and SQL server to pass data between each other i.e hold the

Copying large amounts of data into a SQL CE database

感情迁移 提交于 2019-12-08 01:26:37
问题 If I have a large amount of data in memory, what is the best way to copy it into a SQL CE table? The current technology stack is C#, ADO.net, and SQL CE. My initial idea was to do one INSERT statement for each row of data, but this is time-consuming. Is there an easier way? 回答1: The first thing that popped into my head was to do a sync/merge with a desktop or server database, though that doesn't sound like it really fits your needs. So here is my second thought: BULK INSERT table_name FROM

Implementing Security in ASP.NET Web App as afterthought

故事扮演 提交于 2019-12-08 01:01:13
问题 As with many real world applications out there, the security (login/password) was just there to grant/deny access to the complete application. Now the client has asked for fine grained security like some web pages should only be viewable, some users can delete other cannot etc. basically the client is requesting the following. Effective Permission:: Users--> Web page --> Type of Access (View,Create/Edit,Delete) Details of Application ASP.NET/C# MSSQL Server 2008 for Biz data SQLCE for users

Changes are not saved in SQL Server Compact 3.5 database

寵の児 提交于 2019-12-08 00:42:26
问题 I created a windows application with C# 2010, and I'm using SQL Server Compact Edition 3.5. I'm also using a DataSet to change the DB with a TabelAdapter , and a bindingnavigat to add/edit/delete. The problem is : I can do all these commands during the execution, I can see the rows added and edited in a DataGridView , but when I go to server databases solution and verify my data, no event had been done !! no rows added ! 回答1: Your database may be copied from somewhere/Projectname to somewhere