我试图通过C#创建一个数据库,而不使用SMO,这有可能吗?!我目前有这个,但我99%是错的;有没有办法在MYSQL中创建数据库,而不使用SMO在C#
connectionString2 = "SERVER=" + server + ";" + "DATABASE=master;"
+ "UID=" + uid + ";" + "PASSWORD=" + password + ";"
this.OpenConnection(); //Which opens the above connection
// The Lines array has stored the sql statements to create the databse
// and tables for that database
foreach (string line in lines)
{
create_database += line;
}
MySqlCommand cmd = new MySqlCommand(create_database, connection2);
cmd.ExecuteNonQuery();
实际上是否可以在不使用SMO的情况下做到这一点?
不确定你在说什么类型的数据库服务器。 SMO是MSSQL,但MySsqlCommand是MySQL ... – Sascha 2012-03-13 18:25:53
对不起,Sascha,标题错误! – r0bb077 2012-03-13 18:29:01
删除我MSSQL的答案 – Sascha 2012-03-13 18:31:35