问题描述
朋友们,
我正在使用SQL 2005服务器数据库。我在vb.net 10中开发了一个应用程序。我正在备份。它工作得很好。 bt在恢复时给出了错误。
我的代码是:
Dim query As String
试试
query =从磁盘恢复数据库员工='H:\Stuff \Backup \ backup1.bak'
Dim con As SqlConnection = New SqlConnection(Data Source = .\SQLEXPRESS; Initial Catalog = Trial1; Integrated Security = True; Pooling = False)
con.Open()
Dim cmd As SqlCommand = New SqlCommand (查询,骗局)
cmd.ExecuteNonQuery()
MsgBox(Okk)
Catch ex As Exception
MsgBox(ex.ToString)
结束尝试
这是什么错误?请帮帮我。
hi friends,
i'm using SQL 2005 server database. I hv developed an application in a vb.net 10. i am taking backup. and it is working ver fine. bt while restoring it is giving error.
My code is :
Dim query As String
Try
query = "Restore Database Employee From Disk='H:\Stuff\Backup\backup1.bak' "
Dim con As SqlConnection = New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=Trial1;Integrated Security=True;Pooling=False")
con.Open()
Dim cmd As SqlCommand = New SqlCommand(query, con)
cmd.ExecuteNonQuery()
MsgBox("Okk")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
What is the mistake? please help me out.
推荐答案
这篇关于恢复数据库时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!