Click here to Skip to main content
15,906,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Button get_email

VB
Dim objt As New List(Of Email)
        Dim objbus As New Email
        objt = objbus.Get_Email()
        If objt.Count <> 0 Then
            For Each objbus In objt
                TxtTo.Text = objbus.Emaill
            Next
        End If


Class Email

VB
Public Function Get_Email() As List(Of Email)
        Dim objtela As New CData
        Dim objfem As New List(Of Cparameter)
        Dim objda As New List(Of Email)
        Dim dr As IDataReader
        dr = objtela.executespreturndr("E_Stud", objfem)
        Using dr
            While (dr.Read)

                Dim par As New Email
                populate_email(dr, par)
                objda.Add(par)
            End While
        End Using

        Return objda
    End Function

    Public Sub populate_email(ByVal dr As IDataReader, ByVal objwena As Email)
        objwena.Emaill = dr.GetString(0)
    End Sub



how to display multiple values in one textbox getting them from a single field in a database sql server 2008
Posted

1 solution

I think you are trying to concatenate Email Addresses.
You can do this way.
VB
TxtTo.Text += objbus.Emaill +","


You can use String.Concat method or StringBuilder class that provide various operation on string in .Net.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900