unable to convert system string
See original GitHub issueHI there: im’ using your library to read the excel file as observable class, i’m getting an error message: Message=Unable to convert “(10x8)x2 H Rectangular” from [L:1]:[C:1] to System.String.
This is the code to read the excel file: thanks for your help.
string excelfilepath = fileDialog.FileName;
var excel = new ExcelMapper(excelfilepath) { TrackObjects = true };
excel.AddMapping<Product>("Mainproduct", p => p.Mainproduct) ;
excel.AddMapping<Product>("Name", p => p.Name);
excel.AddMapping<Product>("Price", p => p.Price) ;
excel.AddMapping<Product>("Visible", p => p.Visible) ;
excel.AddMapping<Product>("NameIcon", p => p.NameIcon) ;
Items = new ObservableCollection<Product>(excel.Fetch<Product>().ToList());
foreach (var st in Items)
{
View = CollectionViewSource.GetDefaultView(st);
View.Filter = Filter;
View.Refresh();
}
Issue Analytics
- State:
- Created 8 months ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Powershell 5 : Cannot convert value To System.String
This answer generally explains under what circumstance you'll see the Cannot convert value to type System.String error when passing an argument ...
Read more >PowerShell Script, Cannot convert System.String value to ...
The problem I'm running into is, I check $Body | Get-Member it says the TypeName is System.String. So if it's already a System.String,...
Read more >'Object of type 'System.String' cannot be converted to ...
I got this error System.ArgumentException: 'Object of type 'System.String' cannot be converted to type 'System.String[]'.
Read more >Failed to convert '4' to type 'System.String' - StudioX
Hello UiPath community. I started today learning RPA on UiPath Academy, and I've started building the first automation.
Read more >'Unable to cast object of type 'System.String' ...
'Unable to cast object of type 'System.String' to type 'System.Int32'.' Hi,. I'm trying to get a value from a dictionary. The value is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi There: Monring after rewrtiting the class, i can read the excel file using your library, the view collection also works like a charm, thanks so much. (i yet to figure out write back to the xml file).
view collection get, set:
class products:
Glad you got it to work 👍🏻