Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, I haven’t tried this, but as per your first link, you can detach the database, rename the file on disk and then re-attach the database. So, give that a shot.
The Server object in SMO has a Detach(..) and Attach(..) methods that you can use. Then, just use File.Move(..) to rename the file.