• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Datagrid not displaying results in correct format

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
                MyDataAdapter.Fill(MyDataSet)
                Me.DataGrid1.TableStyles.Clear()
                'DataGrid1.DataMember = "MyDataAdapter"
                DataGrid1.DataSource = MyDataSet  
0
running32
Asked:
running32
  • 2
1 Solution
 
PockyMasterCommented:
You might try to set the datasource to MyDataSet.Tables(0)
0
 
running32Author Commented:
  DataGrid1.DataSource = MyDataSet.Tables(0) still give me the same results.  Thanks
0
 
running32Author Commented:
 DataGrid1.DataMember = MyDataSet.Tables(0).TableName

got it Thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now