Create a database from a DataSet
-
Hi, I'm programming an application using a typed DataSet and a Sql database. I was wondering if there was a way of programmatically creating a database on the server based on the DataSet. What I want to do is during the software installation, the user enters the connection parameters of their Sql server and then the installation program automatically creates the schema/database the software needs on their database server. I thought the simplest way would be to create it from the DataSet. Is there any better way? Thnaks a lot!
-
Hi, I'm programming an application using a typed DataSet and a Sql database. I was wondering if there was a way of programmatically creating a database on the server based on the DataSet. What I want to do is during the software installation, the user enters the connection parameters of their Sql server and then the installation program automatically creates the schema/database the software needs on their database server. I thought the simplest way would be to create it from the DataSet. Is there any better way? Thnaks a lot!
You can't do it from a DataSet. The only way you can do this is one of two ways. One, execute an SQL Script to create the database, setup tables and permissions, and any custom functions, stored procedures, initial data, ... Two, execute the same script commands from a custom action in your installer.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007