3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by vinnarasi
0

How to delete,update records in listview? Changes also affect the database?

How are you loading the data into the listview?

0

How are you loading the data into the listview?

my code is below

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ListView1.Columns.Add("Emp Name", 100, HorizontalAlignment.Left)
        ListView1.Columns.Add("Emp No", 100, HorizontalAlignment.Left)
        ListView1.Columns.Add("Department", 60, HorizontalAlignment.Left)
        ListView1.Columns.Add("Salary", 60, HorizontalAlignment.Left)
      
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim str(4) As String
        Dim itm As ListViewItem
        str(0) = TextBox1.Text
        str(1) = TextBox2.Text
        str(2) = TextBox3.Text
        str(3) = TextBox4.Text
        itm = New ListViewItem(str)
        ListView1.Items.Add(itm)
    End Sub

Now, How can i delete,update in listview?

Edited by John A: added code tags

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.