How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database?

Unfortunately there is currently no designer support (unlike for SQL Server 2005) for building relationships between tables in SQL Server CE. To build relationships you need to use SQL commands such as: ALTER TABLE Orders ADD CONSTRAINT FK_Customer_Order FOREIGN KEY (CustomerId) REFERENCES Customers(CustomerId) If you are doing CE development, i would recomend this FAQ: EDIT: … Read more

Would you like to continue and run the last successful build? [closed]

In VS2008 there are the following options you can set to change the behavior (not sure if there are similar options in other versions of Visual Studio): Projects and Solutions/Build and Run – On Run, when projects are out of date: Always build Never build Prompt to build <== default setting – On Run, when … Read more

Database Deployment Strategies (SQL Server)

For this very problem I chose to use a migration tool: Migratordotnet. With migrations (in any tool) you have a simple class used to perform your changes and undo them. Here’s an example: [Migration(62)] public class _62_add_date_created_column : Migration { public void Up() { //add it nullable Database.AddColumn(“Customers”, new Column(“DateCreated”, DateTime) ); //seed it with … Read more

How does the “Using” statement translate from C# to VB?

Using has virtually the same syntax in VB as C#, assuming you’re using .NET 2.0 or later (which implies the VB.NET v8 compiler or later). Basically, just remove the braces and add a “End Using” Dim bitmap as New BitmapImage() Dim buffer As Byte() = GetHugeByteArrayFromExternalSource() Using stream As New MemoryStream(buffer, false) bitmap.BeginInit() bitmap.CacheOption = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)