Datagrid not displaying results in correct format

Posted on 2006-04-17
Last Modified: 2010-04-23
I have a union select query that populates a dataset which in turn fills up a datagrid.  When the datagrid is populated it has a + when the click the + it read Table and then when you click table it displays the data in the datagrid.  How can I get the data to display immediately.

thank you

MySQL = "Select Firstname, MiddleName, lastname, 'ABSENTEE' as SOURCE from absentee where  lastname like '" & lname & "%' UNION " & _
                "Select Firstname, MiddleName, lastname, 'NLC' from NLC as SOURCE where lastname like '" & lname & "%' UNION " & _
"Select ownername1, '' ,'','PROPERTY_TAX' as SOURCE from propertytax where ownername1 like  '" & lname & "%'"
       Dim MyDataSet As New DataSet
                'DataGrid1.DataMember = "MyDataAdapter"
                DataGrid1.DataSource = MyDataSet  
Question by:running32
    LVL 14

    Accepted Solution

    You might try to set the datasource to MyDataSet.Tables(0)

    Author Comment

      DataGrid1.DataSource = MyDataSet.Tables(0) still give me the same results.  Thanks

    Author Comment

     DataGrid1.DataMember = MyDataSet.Tables(0).TableName

    got it Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    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…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 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