charles_cp
New member
- Joined
- Jul 29, 2005
- Messages
- 1
- Programming Experience
- Beginner
Dear,
I would like to list all of the email address in the TextBox1 from the DB. But the following program just show the first row of the data ("tony@aol.com, "). How to make the TextBox1 showing like that "tony@aol.com, peter@hotmail.com, judy@yahoo.com" ? Please help!
My Code:
--------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Oledb1 As New OleDbConnection
Oledb1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\temp\cus.mdb"
Oledb1.Open()
If Oledb1.State.Open Then
Dim Cmd1 As New OleDbCommand
Cmd1.Connection = Oledb1
Cmd1.CommandText = "Select email&', ' From customer"
TextBox1.Text = Cmd1.ExecuteScalar()
Oledb1.Close()
End If
End Sub
I would like to list all of the email address in the TextBox1 from the DB. But the following program just show the first row of the data ("tony@aol.com, "). How to make the TextBox1 showing like that "tony@aol.com, peter@hotmail.com, judy@yahoo.com" ? Please help!
My Code:
--------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Oledb1 As New OleDbConnection
Oledb1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\temp\cus.mdb"
Oledb1.Open()
If Oledb1.State.Open Then
Dim Cmd1 As New OleDbCommand
Cmd1.Connection = Oledb1
Cmd1.CommandText = "Select email&', ' From customer"
TextBox1.Text = Cmd1.ExecuteScalar()
Oledb1.Close()
End If
End Sub