Reputation: 179
I have an error in my VB.NET program. I have tried various casts, etc., but it just will not resolve the issue - so reluctantly I post it here to see if anyone else has a similar problem.
Error 1 Option Strict On disallows implicit conversions from 'Object' to 'String'.
Private DS As New DataSet ' Languages
Function TransTxt(ByVal Frm As String, ByVal Item As String) As String
Dim language As String
Select Case My.Settings.Language
Case 0 : language = "en" ' English
Case 1 : language = "fr" ' French
Case 2 : language = "it" ' Italian
Case 3 : language = "sp" ' spanish
Case 4 : language = "pt" ' portuguese
Case 5 : language = "de" ' german
Case 6 : language = "du" ' dutch
Case Else : language = "en" ' English
End Select
Try 'ONE of these rows is the error
Dim DR() As DataRow = DS.Tables(Frm).Select("Tag = '" & Item & "'")
Return DR(0).Item(language)
Catch ex As Exception
Return "- error -" & Item
End Try
End Sub
Upvotes: 1
Views: 6555
Reputation: 48587
Return DR(0).Item(language)
is my guess.
Either CAST
to a STRING
type or use Return DR(0).Item(language).ToString()
at the end.
Upvotes: 4