I am trying to populate a list of email addresses and what I have is working fine except for when I have a row with a blank field(no email address)Code:Public emailadd As New List(Of String) Public Function GetEmailAdd() If Table.Rows.Count <= 0 Then MsgBox("There is No Data") End If For Each row As DataRow In Table.Rows Dim email As String = (row(txttocol.Text)) emailadd.Add(email) Next Return emailadd End Function
Not sure the best way to handle this and even if what I am currently doing is the best way to go about my program ie list etc...
This is how i later use the emails in the list
I was thinking of only populating with my list of records that contained an email address and avoiding blanks not sure if linq or select statment is best method or another way?Code:GetEmailAdd() For Each email In emailadd
Can someone help me with a select or linq statement or other idea
Thanks




Reply With Quote