Solved

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

Posted on 2013-01-03
4
1,650 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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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