我的VB.NET代码低于从SQL Server数据库读取的代码。错误:指定的字符串不是电子邮件地址所需的格式
Using conn As New SqlConnection(ConfigurationManager.ConnectionStrings("GasNominationsConnectionString").ConnectionString)
conn.Open()
Using cmd As SqlCommand = conn.CreateCommand
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "getEmailAddress"
cmd.Parameters.Add("company", SqlDbType.VarChar).Value = "RWET"
Dim sqlrd As SqlDataReader = cmd.ExecuteReader()
If sqlrd.HasRows Then
While sqlrd.Read()
msg.[To].Add(New MailAddress("emailAddress"))
End While
End If
End Using
End Using
在SQL Server表中的数据是2个电子邮件地址列表,但我得到一个错误
The specified string is not in the form required for an e-mail address
任何想法我做错了吗?