Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
after i looked the tutorial in code project Restore Database during Application Deployment[^]

i have already make referenced to Microsoft.SqlServer.Management.Smo.dll and declare namespace

but the following code shows the error type or namespace name 'Restore' could not be found

Restore sqlRestore = new Restore();

            BackupDeviceItem deviceItem = new BackupDeviceItem(filePath, DeviceType.File);
            sqlRestore.Devices.Add(deviceItem);
            sqlRestore.Database = databaseName;


how to solve this error
Posted
Updated 25-Jan-14 15:09pm
v2

See this StackOverflow answer[^].

Seems you need to add some more references for it to work.
 
Share this answer
 
Comments
Abhinav S 25-Jan-14 22:26pm    
5.
Right click on project, open references and check if there is an exclamation mark again this dll.
In this case, either the dll is not found or maybe there is a .Net framework version mismatch.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900