954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Database Grid

How do I fix this: Me.dgvData.DataSource = dt, there are three date of birth dropdown list

Private Sub RefreshData()
        If Not cnn.State = ConnectionState.Open Then
            'open connection
            cnn.Open()
        End If

        Dim da As New OleDb.OleDbDataAdapter("SELECT txtstdid as [ID], " & _
                                             "txtstdname as [Name], cbosex as [Gender], chodob1 as [Date Of Birth], chodob2 as [Date Of Birth], chodob3 as [Date Of Birth], txtic as [Identification Number Card], txtpassn as [Passport Number], txtpn as [Phone Number], dod1 as [Date Of Departure], dod2 as [Date Of Departure], dod3 as [Date Of Departure], txtaddress as [Address], txtaapoa [Address At Point Of Arrival] " & _
                                             " FROM plane ORDER by txtstdid", cnn)

        Dim dt As New DataTable
        'fill data to datatable
        da.Fill(dt)

        'offer data in data table into datagridview
        Me.dgvData.DataSource = dt

        'close connection
        cnn.Close()
    End Sub
Attachments 66096.png 172.94KB 66112.png 153.65KB
Jackwong0099
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

No0 need to mention Me.dgvData U can just say dgvData. And moreover what is the problem ur facing?

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 
No0 need to mention Me.dgvData U can just say dgvData. And moreover what is the problem ur facing?

Hey, i just removed the Me. and the result is still the same. "dgvData" is not declared, and it maybe inaccessible due to its protection level. This is the only current problem I'm facing and searched for many helps in forum but couldn't get the answer :(
the link below is the one full version all my codes are inside please have a look thanks... http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/de721f35-c5a0-48cd-8214-b88aea01e292

Jackwong0099
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

TT.... no comments for me

Jackwong0099
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

In designer of the code check for Friend WithEvents dgvData as Datagridview. it should be there if not add. Or if its there then make it public
PUBLIC WithEvents dgvData as Datagridview

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You