简体   繁体   English

如何从ASP.net 2.0中的代码隐藏创建数据库?

[英]How to create database from codebehind in ASP.net 2.0?

I need to create database from codebehind in ASP.net 2.0. 我需要从ASP.net 2.0中的代码隐藏创建数据库。

Please help. 请帮忙。

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();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM