I am trying to use sql mobile for the first time and I want to setup table relationships. I saw a post that said to use VS2005 dataset designer. Is this really setting the relationships on the database or just creating relationships in a dataset
I meant submit the changes when creating a dataset and adding tables to be programatically. ADO.NET offers rick API where one can create entire dB structure within the memory e.g. tables, relationships, constraints etc. You however need to create the adaptor e.g. SqlAdaptor associated with a connection to the underlying dB. Associate this adaptor to the dataset. When submitting, your changes would go to the dB.
You can use ER diagram to create a new diagram, add your tables to it and create relationships by simply selecting a column from one table and dragging and dropping to a column in another table. This will let you create foreign key based relationships.
Unfortunately creation of ER diagrams is not exposed for mobile edition within VS. You have to write the create and alter statements to manage the relationships in mobile edition.
You can use any tools you wish to create the relationships between tables - I personally perfer the old fashion way of writing SQL DDL queries. You can use the data designer within VS to create the relationships or create the relationships programmatically by creating a dataset and adding tables to it. You've to submit the changes so as what you define within dataset gets persisted to the underlying database.
As a best practice, you should create the tables and relationships using best available database tools and than use these tables to create a typed dataset or a resultset or data readers for accessing the data.
Thanks for your reply. You mentioned that it is possible to submit the changes so they are persisted to the underlying database. How is this done when using the VS designer other than saving the xsd
As a best practice you mention the best available database tools to create the relationships. In SQL management studio I can create tables and some constraints but not relationships without using DDL queries. Am I missing something
I understand what you mean now. You mean the changes to the data and not the schema.
I know how to use an ER diagram for other sql versions but I don't know how to create a diagram for sql mobile in management studio. Maybe the only way is to use create and alter statements to manage relationships for mobile edition.
sql mobile constraints-dataset designer?
fakher
I meant submit the changes when creating a dataset and adding tables to be programatically. ADO.NET offers rick API where one can create entire dB structure within the memory e.g. tables, relationships, constraints etc. You however need to create the adaptor e.g. SqlAdaptor associated with a connection to the underlying dB. Associate this adaptor to the dataset. When submitting, your changes would go to the dB.
You can use ER diagram to create a new diagram, add your tables to it and create relationships by simply selecting a column from one table and dragging and dropping to a column in another table. This will let you create foreign key based relationships.
Manav
Mikko Larjava
Unfortunately creation of ER diagrams is not exposed for mobile edition within VS. You have to write the create and alter statements to manage the relationships in mobile edition.
Manav
wyeechen
You can use any tools you wish to create the relationships between tables - I personally perfer the old fashion way of writing SQL DDL queries. You can use the data designer within VS to create the relationships or create the relationships programmatically by creating a dataset and adding tables to it. You've to submit the changes so as what you define within dataset gets persisted to the underlying database.
As a best practice, you should create the tables and relationships using best available database tools and than use these tables to create a typed dataset or a resultset or data readers for accessing the data.
Manav
psycheval
Thanks for your reply. You mentioned that it is possible to submit the changes so they are persisted to the underlying database. How is this done when using the VS designer other than saving the xsd
As a best practice you mention the best available database tools to create the relationships. In SQL management studio I can create tables and some constraints but not relationships without using DDL queries. Am I missing something
JT Thompson
I understand what you mean now. You mean the changes to the data and not the schema.
I know how to use an ER diagram for other sql versions but I don't know how to create a diagram for sql mobile in management studio. Maybe the only way is to use create and alter statements to manage relationships for mobile edition.