Link to home
Start Free TrialLog in
Avatar of MVLIS
MVLISFlag for United States of America

asked on

.net datagridview

I have a datagridview with 2 field in it. When I query a database for some reason it end up with more fields than I have selected and added to the grid.

Public Class InspectData
    Private Context As DataContext
    Private Sub InspectData_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'Connection settings
        Context = New DataContext(True)
        Using cf As New Util.ConnectionForm
            cf.ShowDialog()
            Context.Connect(cf.Server, cf.PortNumber, cf.Partition, cf.UserName, cf.Password)
        End Using

        Engine.Text = InspectStatus.engine.Text

        Engine.Text = "FD620DA00001"


        If String.IsNullOrEmpty(Engine.Text) Then
            Engine.Text = "Please Scan Engine Here."
        Else

            Dim location As String = "I"
            Dim columns = M_METPCols.M_ETDS + M_METPCols.M_EARL

            'retrieve engine scanned from engine master
            Dim troubles = Context.M_METP.RetrieveList(columns, M_METPExprs.M_EARL = "I")

            Engine.Text = "FD620DA00001"

            ' Display the result in the grid view
            Me.TroubleCodes.DataSource = troubles

        End If

    End Sub

End Class
list.png
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MVLIS

ASKER

Thank you very much for your help.