Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What does an error mean
Message
From
24/01/2011 09:57:44
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01497169
Message ID:
01497180
Views:
36
>>>>Hi
>>>>
>>>>I'm converting some code from SQL Express to Mysql
>>>>
>>>>and I'm getting the following error
>>>>
>>>>Overload resolution failed because no Public 'toReadable' can be called with these arguments: 'Public Shared Function toReadable(d As Date) As String': Argument matching parameter 'd' cannot convert from 'Byte()' to 'Date'. 'Public Shared Function toReadable(value As String) As String': Argument matching parameter 'value' cannot convert from 'Byte()' to 'String'."}
>>>>
>>>>In this code
>>>>
>>>>
>>>>               Dim dtMonths As DataTable = dataLayerConnector.getDataTable("SELECT distinct pop as Month from vw_stock_month_model order by pop")
>>>>                For Each row As DataRow In dtMonths.Rows
>>>>                    Dim li As ListItem = New ListItem(toReadable(row("Month")), row("Month"))
>>>>
>>>>
>>>>I've switched the datalayer to read the mysql data . What should be returned is "200905","200906" etc
>>>>
>>>>What would be my basic problem here ?
>>>
>>>The basic problem is that toReadAble() can only accept either a Date or String type as a parameter and presumably row("Month") is neither of those. First step is to determine what *is* the type of row("Month") - you can then decide whether to somehow convert it to a date or string or, probably better, to provide an additional overload for toReadable()......
>>
>>Thanks Viv
>>
>>I looked through the debug information for dtMonths but couldn't find what had been returned (it should get a string). How would I be able to establish exactly what had been passed back.
>
>Can't you just break() at the relevant point and put 'row("Month") in the debugger - that should show the type......
>It looks like it is seeing a byte array but.....

Thanks Viv

Its selecting from a mysql view. When altered it to a table with the value held as varchar it worked ok. I assumed the view would return something edible
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform