Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)

  • Thread starter Thread starter Martin Racette
  • Start date Start date
M

Martin Racette

Hi,

I'm trying to make a programme that will use the above mentioned database,
but I can not find how to create any relation between the tables, all there
is in the database explorer is
DATA CONNECTIONS
DATABASE1.SDF
TABLES
REPLICATION

I can create all the tables, and columns, but I can not find where are the
relation
 
Sorry, but those screen do not appear anywhere in the C# or VB Express
2008, and this is all I have to work with
 
Hi Martin,

You have to create the relationship via code, because the SQL Compact
doesn't support designer for creating the table's relationship like desktop
editions.

So write the following code, if you have for example an order and
orderDetail tables:

Alter table orderDetail add constrain FK_orderDetail_order Foreign key
(orderID) References order (orderID)

Hope this help

Gabor
 
That is a real draw back from SQL Server Express, but at least this one
works as oppose to the previous one

Thank you for the information
 
Back
Top