Click here to Skip to main content
15,909,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I have a problem in database restoring,
I took the database backup from my domain as database backup repositary file, i tried to restore in my local system is showing problem as Specified cast is not valid. (SqlManagerUI).
Can somebody help me in this.


Thanks and regards,
Abdul Rahman.


C#
Specified cast is not valid. (SqlManagerUI)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseGeneral.PopulateGridWithBackupSetsFromDevices()
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseGeneral.GetBackupSetsFromDevices()
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseGeneral.textDeviceSelected_TextChanged(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
   at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
   at System.Windows.Forms.Control.set_Text(String value)
   at System.Windows.Forms.TextBoxBase.set_Text(String value)
   at System.Windows.Forms.TextBox.set_Text(String value)
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseGeneral.buttonSelectDevice_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Posted

When Restoring database please do remember following things
1. Version of both SQL server should be same
2. If you want to another version then create script from another version and run on your local site.But script with data generation is possible only possible is sql server greater than 2005
3. IF both versions are same then check permissions you have provided from local admin.
 
Share this answer
 
Comments
Christian Graus 22-Jan-14 20:15pm    
No, the one you're restoring TO, can be newer than the one you created the backup from.
I'm using SQL server 2008 in my local machine and the domain to which i hosted my website is supporting mylittleadmin 2005 version, I dont know is it suitable to sql server 2008 or not, please somebody help me to solve this.
 
Share this answer
 
I googled and found this advice:

Do "RESTORE FILELISTONLY FROM DISK = N'path to .bak file'" and adjust your RESTORE command's MOVE options to match the files as indicated, so that the RESTORE command can create those files for you.
 
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