I have a database which I need to select all data in a particular column, automatically as long there is a data stored in that column then use that all data(Phone numbers) in sending msg (My system was Send Message System). I already have done sending one by one , but i want to select all the data in the columns in just one click is like Send to ALL option. =) can you help me find the right codes for it. i having hard time which codes should be used.

thanks in advance

I defined a datagridview to pull a table froom a database. The datagridview has AllowUserToAddRows set to false (otherwise there is a Nothing row at the end). Clicking any cell causes that entire column to be copied to the ListBox.

Private Sub DataGridView1_CellClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick

    ListBox1.Items.Clear()

    For Each row As DataGridViewRow In DataGridView1.Rows
        ListBox1.Items.Add(row.Cells(e.ColumnIndex).Value)
    Next

End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.