Creating a SQL Server Database

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

Hi

can anyone tell me if there if any code snippet available for creating a
SQL Server Database and Table using C# web application.

TIA

Barry
 
Hi Barry:

There are at least two different approaches.

One way is to pump SQL like "CREATE DATABASE" and all to the database
with SqlCommand and ExecuteNonQuery(). If you have a database setup
somewhere you can use Enterprise Manager to generate all the database
and table creation commands for you.

Another method is to use SQL-DMO.
http://www.google.com/search?hl=en&lr=&c2coff=1&q=sqldmo+c#
 
Back
Top