Creating a SQL Server Database

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
 
S

Scott Allen

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#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top