再会,
我想显示我的表“订阅者”中的电话号码,并具有与其关联的相同值(作为字符串)。例如,我想显示这些数字:
+12345678
+87654321
这是我的代码:
Dim conStr As String = ConfigurationManager.ConnectionStrings("dbConnectionString").ConnectionString
Dim adapter As New SqlDataAdapter("Select * from tblSubscribers", conStr)
Dim dataset As DataSet = New DataSet
adapter.Fill(dataset)
ListBoxSubscribers.DataSource = dataset.Tables(0)
ListBoxSubscribers.DisplayMember = "Phone"
ListBoxSubscribers.ValueMember = "Phone"
我正在尝试遍历列表框的每个值。问题是我得到 P, h, o, n, e 而不是实际数字。这是我的迭代程序:
For Each item As String In ListBoxSubscribers.ValueMember
Dim PhoneNumber As String = item.ToString
TextBoxPhoneNumberDisplay.Text = PhoneNumber
SendSMS(PhoneNumber, msg)
System.Threading.Thread.Sleep(2000)
Next
谢谢。