Solved

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

Posted on 2013-01-03
4
1,683 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Title # Comments Views Activity
TFS 2015 Access denied. 1 30
How to reference a column by name when iterating through a GridView ? 1 34
Json and ajax 1 23
Build a string of emails from a gridview 2 20
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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