Click here to Skip to main content
15,913,280 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm a newbie to ADO.NET database programming.

1. I have used the VS Designer to create a DataSet-derived class with tables, columns, relations and constraints. All very nice with tons of generated code for all kinds of useful activity.

2. I also have a zero-byte DB file created with the static Connection.CreateFile method.

My question is this: how does one inject the schema from the DataSet into the empty DB file????? I perhaps could re-create the schema using a boatload of Create commands to create the individual tables, relations, etc, but is that really the ONLY way to migrate the schema from a VS Designer-created DataSet to an empty DataSource?

Would I be better off keeping an empty (data-less) instance of the DB file around and copying it to a new file so that I can do a Connection.Open on the copy? It sounds like that would work, but seems a bit of a hack.
Posted
Updated 21-Feb-10 13:53pm
v2

1 solution

The approach I see most is some way to install the structure. Such as a SQL Script you need to run, or a program that runs the DDL from an embedded script.

aspnet_regsql.exe is an example.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900