Conversion from string "Timeofday" to type 'Integer' is not valid.
Conversion from string "Timeofday" to type 'Integer' is not valid.
dvholidays = New DataView(dtholidays, "Date = '" & CDate(e.Day.Date) & "' and Username = 'Perkinsj'", "", DataViewRowState.CurrentRows) If dvholidays.Item("Timeofday").ToString IsNot "" Then Dim iamoff As String = dvholidays.Item("Timeofday").ToString ' Dim iamoff As String = dateallreadybooked.havei(e.Day.Date, "Perkinsj") Select Case iamoff Case "Am" am.ImageUrl = "Images/Dark_Blue_Button.jpg" am.Enabled = True ' enable the button so the user can change this if they no longer want the day booked Case "Pm" pm.ImageUrl = "Images/Dark_Blue_Button.jpg" pm.Enabled = True ' enable the button so the user can change this if they no longer want the day booked Case "full" full.ImageUrl = "Images/Dark_Blue_Buttonlarge.jpg" full.Enabled = True ' enable the button so the user can change this if they no longer want the day booked End Select End If
then you can save reukt in string variable
Dim myDRV As DataRowView
Dim timeofday As String
timeofday = ""
For Each myDRV In dvholidays
For i = 0 To myView.Table.Columns.Count - 1
timeofday = myDRV(i)
Next
Next
then work on this variable
if you know exact column number , use that
For Each myDRV In dvholidays
timeofday = myDRV(1)
Next
You need to specify the row for which you want to get the value.
like
For Each myDRV In myView
For i = 0 To myView.Table.Columns.Count
Console.Write(myDRV(i) & vbTab)
Next
Console.WriteLine()
Next
refer
http://msdn.microsoft.com/en-us/library/23a0aths(v=vs.71).aspx