hi all
i take a backup my sql database
but now problem is how to restore database
i know there are two option
one is sql producer and one is sql query in master database use
but i m successfully in this
please help me in cade or sql producer
How to restore database in sql server
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Roei BarRank #1,271 · 1.4K reputationPosted Oct 23, 2009, 5:58 AM EDT
you should read this post
http://msdn.microsoft.com/en-us/library/ms177429.aspx
or by script
http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/
Dharmesh SharmaRank #1,974 · 741 reputationPosted Oct 23, 2009, 8:17 AM EDT
i m sorry to say because i m not clear my problem
actually i m trying in c# to backup
This is my code
string BackFileName = ""; OpenFileDialog objOFD = new OpenFileDialog(); objOFD.CheckFileExists = true; objOFD.Filter = "Backup Files (*.bak)|*.bak"; if (objOFD.ShowDialog().ToString() == "OK") { string ext = objOFD.FileName.ToString().Substring(objOFD.FileName.ToString().LastIndexOf('.') + 1); if (ext == "bak") { BackFileName = objOFD.FileName; } else if (ext == "") { BackFileName = objOFD.FileName + ".bak"; } if (conn.RestoreDB(BackFileName)) { MessageBox.Show("DataBase Restore suceessfully"); } else { MessageBox.Show("Error in restoring DataBase", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }thanks