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

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
 
M

Martin Racette

Sorry, but those screen do not appear anywhere in the C# or VB Express
2008, and this is all I have to work with
 
G

Gabor

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
 
M

Martin Racette

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top