Backup restore sql database through AttachDBFilename?

First of all - I guess some of your parameters are wrong: ServerConnection connection = new ServerConnection(serverName) Here, you need to pass just the server's name so in your case, do not send in your whole connection string - just SQLExpress As for your database name - I don't know if you can use SMO to backup an "attached" MDF file in SQL Server - normally, this would be the database name (the name of the database only no file name, no extension) when the database is on the server string dataBaseName = @"C:\database\mydb. Mdf So my suggestion here would be: attach this MDF file to your SQL Server instance (which you have installed anyway) give it a meaningful name, e. G mydb then use just the database name as your value here: string dataBaseName = "mydb With these points in place, your code does work just fine in my case, at least.

First of all - I guess some of your parameters are wrong: ServerConnection connection = new ServerConnection(serverName); Here, you need to pass just the server's name - so in your case, do not send in your whole connection string - just . \SQLExpress As for your database name - I don't know if you can use SMO to backup an "attached" MDF file in SQL Server - normally, this would be the database name (the name of the database only - no file name, no extension) when the database is on the server. String dataBaseName = @"C:\database\mydb.

Mdf"; So my suggestion here would be: attach this MDF file to your SQL Server instance (which you have installed anyway) give it a meaningful name, e.g. Mydb then use just the database name as your value here: string dataBaseName = "mydb"; With these points in place, your code does work just fine in my case, at least...

– j4m4l Aug 28 at 18:32 @j4m4l: look at the SMO method AttachDatabase (sample found on MSDN ) – marc_s Aug 28 at 18:38.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions