sql-server-ce

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

一笑奈何 提交于 2019-12-06 08:16:46
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. 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 blocks directories from being checked in Verify that your web.config file has the proper version of the

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

此生再无相见时 提交于 2019-12-06 07:38:23
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. 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 (tableName == null) throw new ArgumentNullException("tableName"); if (string.IsNullOrWhiteSpace(tableName))

SqlCe opens slow under a limited user account in Windows XP

风流意气都作罢 提交于 2019-12-06 07:38:07
I have a windows application built with .NET 4.0. It has a SqlCe database under its program files directory: C:\Program Files\Company Name\Application Name\Data\Data.sdf This application is installed with Inno Setup and the Data folder is given permission with this inno setup configuration: [Dirs] Name: {app}\Data; Permissions: users-modify However, even if I deploy this application without the installer (just zip up all the files from my development machine and unzip on the target machine's desktop) I still face these same issues. So I do not think it is a file directory permission issue. For

Create database file (.sdf) if doesn't exists?

佐手、 提交于 2019-12-06 06:45:53
问题 Just wondering about some practice about this; I have made a simple visual C# program with local database (SQL CE) (dB.sdf file). Let's say user deletes the dB.sdf file and try to open the exe program - nothing happens (the exe file starts but closes again). What's the typically practice here? Is it that the program just won't start or is it to make the program create a database file if it doesn't exists? If it is the latter, how is it done? 回答1: The second approach is more wise as your

Does SQL Server CE support schema update with NHibernate?

喜你入骨 提交于 2019-12-06 06:42:10
问题 SchemaExport seems to work, but SchemaUpdate fails - the SchemaUpdate.Exceptions contains this object: System.NotSupportedException: The method is not supported. in System.Data.Common.DbConnection.GetSchema(String collectionName, String[] restrictionValues) in NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) in NHibernate.Tool.hbm2ddl.DatabaseMetadata.GetTableMetadata(String name, String schema, String

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-06 05:56:41
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 this with: CREATE TABLE dummy ( id int not null primary key identity (1, 1), value nvarchar(20) not null )

Changes are not saved in SQL Server Compact 3.5 database

久未见 提交于 2019-12-06 04:10:53
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 ! Your database may be copied from somewhere/Projectname to somewhere/Projectname/bin/Debug/. Check properties on database file in your project tree. There should be "Copy to

How to deploy SqlCe Database into isolatedStorage for windows phone

社会主义新天地 提交于 2019-12-06 03:48:31
问题 say, I want to use an existing SqlCe Database which HAS data in it. I am not sure which is the best way to do it. 1) here is the normal way to create a SqlCe Database for Windows phone using (CountryDataContext context = new CountryDataContext(ConnectionString)) { if (!context.DatabaseExists()) { // create database if it does not exist context.CreateDatabase(); } } But this Database has data in it , so I dont want to create it. I want to deploy it or store in in isolatedStorage. How should I

Is SQL Server Compact Edition a sensible alternative to SQLite?

三世轮回 提交于 2019-12-06 03:32:52
问题 What are the differences, other than a file size restriction in SQL Server Compact, and Windows only usage? 回答1: I've found a couple of questions and some blog posts relating to this. A small comparison of their memory usage can be found here. 来源: https://stackoverflow.com/questions/3301370/is-sql-server-compact-edition-a-sensible-alternative-to-sqlite

Correct DateTime format in SQL Server CE?

半腔热情 提交于 2019-12-06 03:06:26
问题 I have a C# DateTime class and wanted to know how I need to format it in a SQL Server CE query to insert it into the database, I was hoping to have both the date and time inserted in. Currently when I try variations thereof I get invalid format exceptions. Current format I'm using is: dd/MM/yyyy , was hoping to do something like dd/MM/yyyy hh:mm:ss . The way I'm trying to do the insert is like so: ( ( DateTime )_Value ).ToString( "dd/MM/yyyy hh:mm:ss" ) Obviously hh:mm:ss isn't working, if