Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

20 Experts available now in Live!

Get 1:1 Help Now