Public Class Recipients
Private Sub Recipients_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mycom.Connection = cn
mycom.CommandText = "Select Idno,Name,Course,YearSec,Organization from tbl_students"
myr = mycom.ExecuteReader
While myr.Read
With grdRecipients
.Rows.Add()
.Rows(.RowCount - 1).Cells(0).Value = myr(0).ToString
.Rows(.RowCount - 1).Cells(1).Value = myr(1).ToString
.Rows(.RowCount - 1).Cells(2).Value = myr(2).ToString
.Rows(.RowCount - 1).Cells(3).Value = myr(3).ToString
.Rows(.RowCount - 1).Cells(4).Value = myr(4).ToString
End With
End While
myr.Close()
End Sub
End Class
I have a grid view called grdRecipients which loads the data in my database using the select statement. Column names are manually inputted in the data grid view. Any help with automatically creating their own column names and adding a checkbox column.
Any help is apprecited. . . thanks