请问:备份数据库时出现有关问题
请教:备份数据库时出现问题
我在用vb.net备份数据库时,出现 "未定义类型SqlConnection "
请教各位高手,这是怎么回事?
用的下面的代码:
Dim strcon As String
Dim strsql As String
Dim con As SqlConnection
Dim com As SqlCommand
Dim databasepath As String
Dim pos As Integer
databasepath = Application.ExecutablePath
pos = InStrRev(databasepath, "\ ")
databasepath = Mid(databasepath, 1, pos) & "backup\databaseback.bak "
strcon = "server=localhost;database=humanadministration;uid=cxl;pwd=cxl; "
con = New SqlConnection(strcon)
strsql = "backup database yourdatabase to disk= ' " & databasepath & " ' "
com = New SqlCommand(strsql, con)
我在用vb.net备份数据库时,出现 "未定义类型SqlConnection "
请教各位高手,这是怎么回事?
用的下面的代码:
Dim strcon As String
Dim strsql As String
Dim con As SqlConnection
Dim com As SqlCommand
Dim databasepath As String
Dim pos As Integer
databasepath = Application.ExecutablePath
pos = InStrRev(databasepath, "\ ")
databasepath = Mid(databasepath, 1, pos) & "backup\databaseback.bak "
strcon = "server=localhost;database=humanadministration;uid=cxl;pwd=cxl; "
con = New SqlConnection(strcon)
strsql = "backup database yourdatabase to disk= ' " & databasepath & " ' "
com = New SqlCommand(strsql, con)