0

i have a file excel and i imported it into sql 2005 with it's name is QLHP ,now i want to delete QLHP database in sql 2005 using c#.
Please help me!
Thanks so much!

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by thuyson
0

You could start using the SMO Library, provided by SQL Managment studio.

Here are some basics that will help you understand SMO:

SQL batips

EggHead Cafe

Hope i helped, and dont forget to mark the thread as solved if i found the solution for you :D

0
...
sqlconnection cnn = new sqlconnection ("server=....");
cnn.open();
sqlcommand cmd = cnn.createcommand();
cmd.commandtext = string.format("use master; drop database '{0}'", "QLHP");
cmd.executenonquery();
cnn.close();
...
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.