0

whats wrong with this code???
the vb always tell that items is not a member?

Imports MySql.Data.MySqlClient

Public Class search
    Public conn As New MySqlConnection

    Private Sub search_load(ByVal server As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If conn.State = ConnectionState.Closed Then
            conn.ConnectionString = "SERVER = localhost; USERID = root; PASSWORD =; DATABSE = kahuna  "
        End If
        LoadPeople()
    End Sub

    Public Function WithDrawal(ByVal Amount As Decimal, _
      ByVal TransactionCode As Byte) As Double
        ' Add code here to perform the withdrawal,
        ' return a transaction code, 
        ' or to raise an overdraft error.
    End Function


    Public Sub LoadPeople()
        Dim sqlQuery As String = "SELECT * FROM reservation"
        Dim sqlAdapeter As New MySqlDataAdapter
        Dim sqlcmd As New MySqlCommand
        Dim rdr As MySqlDataReader = sqlcmd.ExecuteReader()
        Dim TABLE As New DataTable
        Dim i As Integer
        Dim Items As String = ""

        With sqlcmd
            .CommandText = sqlQuery
            .Connection = conn
        End With

        With sqlAdapeter
            .SelectCommand = sqlcmd
            .Fill(TABLE)
        End With

        For i = 0 To TABLE.Rows.Count - 1
            With Me
                .Items.Add(TABLE.Rows(i)("number"))
                With .Items(.Items.Count - 1).subitems
                    .Add(TABLE.Rows(i)("RoomType"))
                    .Add(TABLE.Rows(i)("Name"))
                    .Add(TABLE.Rows(i)("Location"))
                    .Add(TABLE.Rows(i)("Email"))
                    .Add(TABLE.Rows(i)("Phone"))
                    .Add(TABLE.Rows(i)("NoGuest"))
                    .Add(TABLE.Rows(i)("NoRoom"))
                    .Add(TABLE.Rows(i)("BookingType"))
                    .Add(TABLE.Rows(i)("Payment"))
                    .Add(TABLE.Rows(i)("ADate"))
                    .Add(TABLE.Rows(i)("DDate"))
                    .Add(TABLE.Rows(i)("Message"))

                End With
            End With
        Next
    End Sub

End Class
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by ShahanDev
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.