Reputation: 5049
I'm trying to import the schema of NorthWind database to DataSet using VS2010, and .Net Framework 4.
I have tried to use the designer and the FillSchema method, but neither of those ways let me import the relations so that i have to specify them by hand on the designer or by code.
The relations information is on the Database schema.
Had anybody retrieved all the relations successfully without specify them one by one ?
PS: I'm accessing the database by ODBC (postgresql and MDB drivers tested).
Upvotes: 0
Views: 852
Reputation: 3963
Although I have not used NorthWind the steps to do this with MSQL are as follows
Create the data relations in the database itself
In Visual Studio go to the Data Sources window (View > Other Windows > Data Sources or Shift-alt-D)
Click Add a New DataSource Icon which will bring up the Data Source Configuration Wizard
The Data Source Configuration Wizard creates and edits data sources in your application. These data sources can be made from databases, services, or objects.
Database
, and select a database model of a dataset
, give it a
connection string and select your tables, you should see a file in
your solution for the dataset. Open this up to see the database
diagram which will include your database relationships, aka foriegn
keys.Upvotes: 1