how restore database backup use c#
<p>I want restore backup SQL use c# </p>

<p>Error is : Restore failed for Server</p>

<p>My code :</p>

<pre><code> Server srv;
    ServerConnection servercon;
    SqlConnection sqlcon = new SqlConnection("Data Source=.;Initial Catalog=doctor;Integrated Security=True");
    private void button_load_backup_Click(object sender, RoutedEventArgs e)
    {

        servercon = new ServerConnection(sqlcon);
        srv = new Server(servercon);
        Restore res = new Restore();
        res.Database = "doctor";
        res.Action = RestoreActionType.Database;
        res.Devices.AddDevice(textBox_address.Text, DeviceType.File);
        res.PercentCompleteNotification = 10;
        res.ReplaceDatabase = true;
        res.SqlRestore(srv);

    }
</code></pre>

<p>Please help me</p>
