sql-server-ce

How do I specify that a property should generate a TEXT column rather than an nvarchar(4000)

与世无争的帅哥 提交于 2019-11-26 13:56:01
问题 I'm working with the Code First feature of Entity Framework and I'm trying to figure out how I can specify the column data types that should be created when the database is auto-generated. I have a simple model: public class Article { public int ArticleID { get; set; } public string Title { get; set; } public string Author { get; set; } public string Summary { get; set; } public string SummaryHtml { get; set; } public string Body { get; set; } public string BodyHtml { get; set; } public

Connection string with relative path to the database file

拟墨画扇 提交于 2019-11-26 10:43:43
问题 I load data from sdf database in winforms App. I use full path to the database file . Example : conn = new SqlCeConnection { ConnectionString =\"Data Source=F:\\\\My Documents\\\\Project1\\\\bin\\\\Debug\\\\Database.sdf\" }; I d like use a relative path to the database file. For example. I have sdf file in folder F:\\My Documents\\Project1\\bin\\Debug\\Data\\file.sdf and I want use relative path in connection string. Any advice ? Thank you. 回答1: Relative path: ConnectionString = "Data Source=

How to connect to SQL Server from another computer?

风格不统一 提交于 2019-11-26 09:27:32
问题 I want to connect from home using SQL Server 2005 to another PC. I had a look on the msd...but before connecting it says I should connect to another computer using the computer management and it didn\'t work out....I can only connect to computers from my workgroup? Thanks, Luisa 回答1: If you want to connect to SQL server remotly you need to use a software - like Sql Server Management studio. The computers doesn't need to be on the same network - but they must be able to connect each other

Using Entity Framework with an SQL Compact Private Installation

僤鯓⒐⒋嵵緔 提交于 2019-11-26 09:18:52
问题 I am using Entity Framework 4 in a desktop application with SQL Compact. I want to use a private installation of SQL Compact with my application, so that my installer can install SQL Compact without giving the user a second installation to do. It also avoids versioning hassles down the road. My development machine has SQL Compact 3.5 SP1 installed as a public installation, so my app runs fine there, as one would expect. But it\'s not running on my test machine, which does not have SQL Compact

How to deploy SQL Server Compact Edition 4.0?

情到浓时终转凉″ 提交于 2019-11-26 07:07:18
问题 How do i deploy Microsoft SQL Server Compact 4.0? SQL Server Compact Edition (currently at version 4.0) is: a free, embedded database that software developers can use for building Windows desktop applications. It has a small footprint and supports private deployment of its binaries within the application folder. But how do you actually deploy it? Microsoft says it can be deployed within the application folder (good) and supports xcopy deployment. Microsoft also says it cannot be deployed

Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2

青春壹個敷衍的年華 提交于 2019-11-26 05:27:53
问题 I\'m using Visual Studio 2008 Pro. I\'m probably missing something very obvious here, but I\'ve been trying to get the CTP for Sql Server compact 4 to work in my asp.net mvc application. I can find next to no instruction on how to set this up or a working example application. My goal is a private install so I can just include it in my web app without having to do sql server setup on my domain hosting. This is really just me shooting the breeze and trying to figure this out. I don\'t plan to

Is SQL Server Compact discontinued from Visual Studio 2013?

陌路散爱 提交于 2019-11-26 04:46:13
问题 when I tried to create a new SQL Server Compact file from Visual Studio -> Add New Item, I don\'t see the \'Local Database\' option any more which was actually the way to add SQL Server Compact Database. Now, if it is really discontinued from Microsoft, then, what is the recommended Embedded Database technology from Microsoft for Desktop Applications ? I tried SQLite but deployment is headache for SQLite because, the user may not have correct version of Visual C++ distributable installed in

Why saving changes to a database fails?

若如初见. 提交于 2019-11-25 21:43:53
问题 I have following C# code in a console application. Whenever I debug the application and run the query1 (which inserts a new value into the database) and then run query2 (which displays all the entries in the database), I can see the new entry I inserted clearly. However, when I close the application and check the table in the database (in Visual Studio), it is gone. I have no idea why it is not saving. using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq