31-03-21, 12:56 AM
هذا الكود
Private cmd As New SqlCommand
Dim red As SqlDataReader
Dim op As New OpenFileDialog
Dim opf As New FolderBrowserDialog
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Try
If txt1char.Text = "C" Then
MessageBox.Show("حاول مجدداً C:\ لا يمكن حفظ النسخة الاحتياطية على الجذر ", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Dim DATABASEE As String = My.Settings.DataBase
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=" & DATABASEE & ";Integrated Security=True")
'Dim datab As String
'datab = "DB_ACC"
'datab = My.Settings.DataBase
If txt_path.Text = "" Then
MessageBox.Show(" يجب اختيار المسار اولا", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
Dim Filename As String = txt_path.Text + "\ " + DATABASEE + " " + DateTime.Now.ToShortDateString().Replace("/", "-") + " - " + DateTime.Now.ToLongTimeString().Replace(":", "-") & ".bak"
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim querey As String = "backup database " & DATABASEE & " to disk='" & Filename & "'with init,stats=10"
cmd = New SqlCommand(querey, con)
cmd.ExecuteNonQuery()
con.Close()
MessageBox.Show(" تمت عملية النسخ بنجاح", "تاكيد", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.ToString, "تنبيه")
End Try
End Sub
Private cmd As New SqlCommand
Dim red As SqlDataReader
Dim op As New OpenFileDialog
Dim opf As New FolderBrowserDialog
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Try
If txt1char.Text = "C" Then
MessageBox.Show("حاول مجدداً C:\ لا يمكن حفظ النسخة الاحتياطية على الجذر ", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Dim DATABASEE As String = My.Settings.DataBase
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=" & DATABASEE & ";Integrated Security=True")
'Dim datab As String
'datab = "DB_ACC"
'datab = My.Settings.DataBase
If txt_path.Text = "" Then
MessageBox.Show(" يجب اختيار المسار اولا", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
Dim Filename As String = txt_path.Text + "\ " + DATABASEE + " " + DateTime.Now.ToShortDateString().Replace("/", "-") + " - " + DateTime.Now.ToLongTimeString().Replace(":", "-") & ".bak"
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
Dim querey As String = "backup database " & DATABASEE & " to disk='" & Filename & "'with init,stats=10"
cmd = New SqlCommand(querey, con)
cmd.ExecuteNonQuery()
con.Close()
MessageBox.Show(" تمت عملية النسخ بنجاح", "تاكيد", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.ToString, "تنبيه")
End Try
End Sub
تطبيق للجوال يشبه تطبيق حراج
سورس كود برنامج محاسبة ومبيعات احترافي
سورس كود تطبيق ارسال رصيد من الجوال B4A
سورس كود تطبيق مبيعات للجوال
تيليجرام Abo_anas_kahwaji@
واتساب 00963951283515

