| | |
Restoring SQL Database
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
I am developing an application an am intrested in having to be able to backup and restore the full SQLServer database from the front end. i have succesfully done the the back up module using the code below
but when i tried using the same model for the restore it give a massage that i do not have exclusive acces to perform the action
Try
Using dc As New SqlClient.SqlConnection(My.Settings.TRONICALConnectionString)
dc.Open()
Using dcom As New SqlClient.SqlCommand("BACKUP DATABASE TRONICAL TO DISK = '" & FileName & "'WITH FORMAT,NAME = 'Full Backup of TRONICAL'", dc)
dcom.ExecuteNonQuery()
'MessageBox.Show("Data base Backup" & dcom.ExecuteNonQuery(), "BACKUP", MessageBoxButtons.OK, MessageBoxIcon.Information)
dcom.CommandText = "BACKUP LOG TRONICAL TO DISK = '" & Replace(FileName, ".PrimeBU", ".PrimeBULOG") & "'WITH FORMAT,NAME = 'Full Backup of TRONICAL LOG'"
dcom.ExecuteNonQuery()
'MessageBox.Show("Database Log Backup" & dcom.ExecuteNonQuery(), "BACKUP", MessageBoxButtons.OK, MessageBoxIcon.Information)
MessageBox.Show("Database Successfully Backup", "BACKUP", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Using
End Using
Catch ex As Exception
MessageBox.Show("Backup Error" & Chr(13) & ex.Message, "BACKUP ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try![]() |
Similar Threads
- add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0 (ASP.NET)
- Problem Inserting into SQL database on server (ASP.NET)
- Adding a column to an SQL database (VB.NET)
- Update SQL database automatically using VB6 (Visual Basic 4 / 5 / 6)
- SQL Database loop (C#)
- Insert into sql database (ASP.NET)
- Process very slow - SQL Database (MS SQL)
- Help with Roles Stored in SQL database (ASP.NET)
- Snyc'n Local SQL database online (MS SQL)
Other Threads in the VB.NET Forum
- Previous Thread: Array in VB.net
- Next Thread: Grouping DataGridView Column Results
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array arrays basic bing button buttons c# center check checkbox code combobox convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web winforms wpf year





