How to identify whether the table has identity column
IF (OBJECTPROPERTY(OBJECT_ID(‘TABLE_NAME’), ‘TableHasIdentity’) = 1) ObjectProperty is available starting sql server 2008 Reference: OBJECTPROPERTY
IF (OBJECTPROPERTY(OBJECT_ID(‘TABLE_NAME’), ‘TableHasIdentity’) = 1) ObjectProperty is available starting sql server 2008 Reference: OBJECTPROPERTY
The answer is yes: Microsoft is silently dropping support (as usual IMHO) to Sql Compact Edition. It started abandoning Sql CE 3.5 in Vs2012 It continued dropping Sql CE in Sql Management Studio 2012 and finally in VS2013 You can use CompactView or install SQL Server Compact Toolbox extension in VS2013 or (my prefered solution) … Read more
There is some good info here: Create a SQL Server Compact Edition Database with C# string connectionString = “DataSource=\”test.sdf\”; Password=\”mypassword\””; SqlCeEngine en = new SqlCeEngine(connectionString); en.CreateDatabase();
Try LINQPad, it works for SQL Server, MySQL, SQLite and also SDF (SQL CE 4.0). Best of all it’s free! Steps with version 4.35.1: click ‘Add Connection’ Click Next with ‘Build data context automatically’ and ‘Default(LINQ to SQL)’ selected. Under ‘Provider’ choose ‘SQL CE 4.0’. Under ‘Database’ with ‘Attach database file’ selected, choose ‘Browse’ to … Read more
See this answer: Database functionality with WPF app: SQLite, SQL CE, other? – SQL Compact 4 has full support for Entity Framework, Linq to SQL – Includes all neccesary file for private deployment – has good tools support in Visual Studio 2010 and 2012 – has a smooth migration path to SQL Server
I appreciate the effort that went into the existing answer, but I haven’t found it actually answering the question… so I tested this, and found out that [Column(TypeName = “ntext”)] public string Body { get; set; } (the one from System.ComponentModel.DataAnnotations) will work to create an ntext type column. (My problem with the accepted answer … Read more
I’m not sure about encryption, but you’ll probably find this link helpful: http://msdn.microsoft.com/en-us/library/ms171955.aspx As for the rest of it: “Text” and “auto_increment” remind me of Access. SQL Server Compact is supposed to be upgrade compatible to the server editions of SQL Server, in that queries and tables used in your compact database should transfer to … Read more
Yes, SQL Server Compact has been deprecated (see the comments on this Connect item). You should be using SQL Server Express or SQL LocalDB. Some posts: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx http://blogs.msdn.com/b/jerrynixon/archive/2012/02/26/sql-express-v-localdb-v-sql-compact-edition.aspx http://erikej.blogspot.com/2011/01/comparison-of-sql-server-compact-4-and.html http://erikej.blogspot.com/2012/07/the-state-and-near-future-of-sql-server.html
Do you maybe need something like this: var unspecified = new DateTime(2016, 12, 12, 10, 10, 10, DateTimeKind.Unspecified); var specified = DateTime.SpecifyKind(unspecified, DateTimeKind.Utc); About SpecifyKind() method from MSDN: The SpecifyKind method creates a new DateTime object using the specified kind parameter and the original time value. It will create new object, new Kind and same … Read more
Download and install LINQPad, it works for SQL Server, MySQL, SQLite and also SDF (SQL CE 4.0). Steps for open SDF Files: Click Add Connection Select Build data context automatically and Default (LINQ to SQL), then Next. Under Provider choose SQL CE 4.0. Under Database with Attach database file selected, choose Browse to select your … Read more