Expression for comparing two fields from two different tables - ReportViewer & Visual Studio 2005

Posted on 2007-07-27
Last Modified: 2013-11-26
I need to compare two fields from two different tables but on the same dataset. I need to make sure that if these two fields are equal on both tables then their background color will be changed.

I don't know how to build an expression for this.

Can someone give me an example for such expression?

Any help will be highly appreciated!
Thank you all!
Question by:nahumba
    LVL 24

    Accepted Solution

    dim ds as dataset
    dim x,y as integer

    for x=0 to ds.tables("Table1").rows.count-1
    for y=0 to ds.tables("Table2").rows.count-1

    if ds.tables("Table1").rows(x)("Field1")=ds.tables("Table2").rows(y)("Field2") then
     ' .... change colors .....

    next y
    next x

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    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…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 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

    7 Experts available now in Live!

    Get 1:1 Help Now