hey guyz.. i will bold the line that crashed.. it crashed when i was adding the parameters in the vb.net section
just in case i will post the stored procedure part alos
this is the vbcode i used
VB Code:
Dim myconnection As New SqlConnection(myConnectString) myconnection.ConnectionString = myConnectString myCommand = New SqlCommand("spRestoreDatabase", myconnection) myconnection.Open() myCommand.CommandType = CommandType.StoredProcedure [b] myCommand.Parameters.Add(New SqlParameter("@Name", RestoreName, "@Path", RestorePath))[/b] myCommand.ExecuteNonQuery() MsgBox("Data Restored") myconnection.Close()
This is the stored procedure that i used
VB Code:
Create Procedure spRestoreDatabase @Name as VARCHAR(1000), @Path as VARCHAR(1000) As Restore Database @Name From Disk = @Path GO




Reply With Quote