Reputation: 8876
I need to create database from codebehind in ASP.net 2.0.
Please help.
Upvotes: 0
Views: 657
Reputation: 19021
May be like this:
SqlConnection connection = new SqlConnection(connectionString);
SqlCommand command = new SqlCommand("CREATE DATABASE database_name", connection);
command.Connection.Open();
command.ExecuteReader();
connection.Close();
Upvotes: 1