How to put data from database to list view in VB.NET?

this is all about how to create a code for list view in VB.NET

Page 1 of 1

1 Replies - 17946 Views - Last Post: 26 March 2010 - 09:24 AM Rate Topic: -----

#1 sheena1989  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-January 10

How to put data from database to list view in VB.NET?

Posted 26 March 2010 - 09:05 AM

We have a project to make using the MS ACCESS as our database and VB.NET. The project called "ELECTRONIC DICTIONARY". I got trouble creating the code for retrieving the data in the list view of the VB.NET. please help me how..teach me what's the right codes for it.

Here's my code:
   Private Sub lvresult_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvresult.Click
        If Me.lvresult.Items.Count <> 0 Then
            modedict.condbdictmod()
            modedict.recdict.Open("Select * from TBLDICTIONARY where WORDNAME=" & _
            Me.lvresult.SelectedItems(1).text & "'", modedict.condict, 3, 1)
            modedict.recdict.Fields("WordName").Value = Me.txtWORd.Text
            modedict.recdict.Fields("WordDescription").Value = Me.txtDEF.Text
            modedict.recdict.Fields("WordSynonym").Value = Me.txtSYn.Text
            modedict.recdict.Fields("WordAntonym").Value = Me.txtANTON.Text()
            modedict.recdict.Close()
        Else
            MessageBox.Show("You cannot select empty items", "Error", _
          MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If

    End Sub


IS this the proper code for this?
We are required to retrieve only the WORDS in the database in list view. But we need to load the information of the books also.

Admin Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Is This A Good Question/Topic? 0
  • +

Replies To: How to put data from database to list view in VB.NET?

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1634
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to put data from database to list view in VB.NET?

Posted 26 March 2010 - 09:24 AM

This is more a VB.NET related than Database related. Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1