Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WP_Categories_to_Tags has a deprecated constructor in C:\inetpub\vhosts\omuronline.com\httpdocs\wp-content\plugins\wpcat2tag-importer\wpcat2tag-importer.php on line 31
C# Form ile Sql Database Yedek Almak – A. Ömür Çam – Yazılım Blog İçeriğe geç

C# Form ile Sql Database Yedek Almak

C# form ile Sql Veritabanı yedek alma işlemi:
form.cs kodu :
namespace sqlyedek
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void btnyedekal_Click(object sender, EventArgs e)
{
SqlConnection bag = new SqlConnection();
bag.ConnectionString = “server=.;initial catalog=databaseadi;integrated security=true”;
string komutCumle = “backup database model to disk=’databaseadi_'”;
SqlCommand komut = new SqlCommand(komutCumle, bag);
bag.Open();
komut.ExecuteNonQuery();
bag.Close();

}
}
}

İşlem sonucunda C/ klasöründeki mssql dosyasında backup klasörü içerisine “databaseadi_” adında .bck dosyası oluşturuldu.

Tarih:C#