Getting the following error:
System.InvalidCastException: Conversion from string "{"UniqueName":"dckOrderHistory"," to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) at Dealers_Toolbox_portal.RetrievePortalState() in D:\Net Folders\Development Web Sites\Smoker\Dealers\Toolbox\portal.ascx.vb:line 51
Here is the value stored in the database:
Here is the code: (Line 51 is the Deserialize line) What am I doing wrong? Thanks!
System.InvalidCastException: Conversion from string "{"UniqueName":"dckOrderHistory"," to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) at Dealers_Toolbox_portal.RetrievePortalState() in D:\Net Folders\Development Web Sites\Smoker\Dealers\Toolbox\portal.ascx.vb:line 51
Here is the value stored in the database:
{"UniqueName":"dckOrderHistory","DockZoneID":"ctl00_ContentPlaceHolder1_RadDock_RadDockZone1","Width":"300px","Height":"","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"Order History","Text":"","Tag":"~/Dealers/Toolbox/PortalControls/OrderHistory.ascx","Index":"1"}|{"UniqueName":"dckBrowseBoats","DockZoneID":"ctl00_ContentPlaceHolder1_RadDock_RadDockZone1","Width":"300px","Height":"","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"Browse Boats","Text":"","Tag":"~/Dealers/Toolbox/PortalControls/BrowseBoats.ascx","Index":"0"} |
Here is the code: (Line 51 is the Deserialize line) What am I doing wrong? Thanks!
Dim lDockState As New List(Of DockState) |
Dim sDockState() As String = oRdr.Item("PortalState").ToString.Split("|"c) |
For Each i As String In sDockState |
Dim state As DockState = DockState.Deserialize(sDockState(i)) |
lDockState.Add(state) |
Next |
RetrievePortalState = lDockState |