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!

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

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

thanhk u so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.