Results 1 to 3 of 3

Thread: Other Fields Missing in ListView

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Smile Other Fields Missing in ListView

    vb.net Code:
    Code:
    Dim lvwItem As New ListViewItem()Dim sSQL As String = String.EmptysSQL = "SELECT TimeIn,TimeOut FROM (Time_IN_OUT) "sSQL = sSQL & "WHERE EmpNo = '" & ListEmp.SelectedItem & "' "sSQL = sSQL & and ShiftMonth = '" & ComboPeriod.SelectedItem & "'"Dim SELMonthPeriod As New OleDb.OleDbCommand(sSQL, con)Dim READMonthPeriod As OleDb.OleDbDataReader = SELMonthPeriod.ExecuteReader() While READMonthPeriod.Read()    lvwItem = ListView1.Items.Add(READMonthPeriod.GetString(0))    lvwItem.SubItems.Add(READMonthPeriod.GetString(1))            End While __________________
    having this code. i only get the first column of data in listview, the TimeOUT column doesnt appear... can anyone correct this code or comment and suggestions. THANKS.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Re: Other Fields Missing in ListView

    ***.. first of all., how can i make new lines.. harhar..

    Dim lvwItem As New ListViewItem()Dim sSQL As String = String.EmptysSQL = "SELECT TimeIn,TimeOut FROM (Time_IN_OUT) "sSQL = sSQL & "WHERE EmpNo = '" & ListEmp.SelectedItem & "' "sSQL = sSQL & and ShiftMonth = '" & ComboPeriod.SelectedItem & "'"Dim SELMonthPeriod As New OleDb.OleDbCommand(sSQL, con)Dim READMonthPeriod As OleDb.OleDbDataReader = SELMonthPeriod.ExecuteReader()

    While READMonthPeriod.Read()
    lvwItem = ListView1.Items.Add(READMonthPeriod.GetString(0)) lvwItem.SubItems.Add(READMonthPeriod.GetString(1))
    End While __________________

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Other Fields Missing in ListView

    vb Code:
    1. Dim lvwItem As New ListViewItem(READMonthPeriod.GetString(0))
    2. lvwItem.SubItems.Add(READMonthPeriod.GetString(1))
    3. listview1.items.add(lvwItem)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width