| | |
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 2008 access add advanced application array basic beginner browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse employees excel exists fade filter forms function html images listview map mobile module msaccess mysql net number objects open page pan panel pdf picturebox picturebox2 port position print printing printpreview read regex reuse right-to-left save search serial settings shutdown socket sorting sqldatbase sqlserver storedprocedure temperature textbox timer timespan transparency txttoxmlconverter usercontol validation vb vb.net vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winforms winsock wpf wrapingcode xml year





