Solved

Operator '&' is not defined for types 'String' and 'System.Data.DataRowView'.

Posted on 2013-01-03
4
1,623 Views
Last Modified: 2013-01-03
Operator '&' is not defined for types 'String' and 'System.Data.DataRowView'.
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim dtholidays As New DataTable()
        dtholidays = dateallreadybooked.mybookedhols("perkinj")
        Dim myhols As DataView
        myhols = New DataView(dtholidays, "", "", DataViewRowState.CurrentRows)

        For Each Dayitis In myhols
            Mybookedlabel.Text = "<td align='center'>" & myhols.Item("Date") & "</td> <td align='center' >" & myhols.Item("Timeofday") & "</td> <td align='center'>" & myhols.Item("Type") & "</td><td align='center'>" & myhols.Item("bookedon") & "</td>"

        Next

         End Sub

Open in new window

0
Comment
Question by:runnerjp2005
  • 2
4 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 38740659
Try:

Mybookedlabel.Text = "<td align='center'>" + myhols.Item("Date") + "</td> <td align='center' >" + myhols.Item("Timeofday") + "</td> <td align='center'>" + myhols.Item("Type") + "</td><td align='center'>" + myhols.Item("bookedon") + "</td>"

Open in new window

0
 

Author Comment

by:runnerjp2005
ID: 38740698
BC30452: Operator '+' is not defined for types 'String' and 'System.Data.DataRowView'.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 38740761
Item is not a String and Option Strict is probably set to On (which is a good thing).

Try adding ToString after each of the items: myhols.Item("Date") .ToString()
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 38740781
Yep, I didn't see that one.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now