vb.net edit
-
In a vb.net 2010 application, I have the following code setup so far:
Dim _dtEmailaddress As DataTable = SelectEmailAddress(_dtPersonID(0)("SPA_PersonID"))
Dim _email As String = String.Empty
If _dtEmailaddress.Rows.Count > 0 Then
If IsDBNull((_dtEmailaddress(0)("email"))) Then
_letter = _letter.Replace("&SPA_EMAIL.EVAL", "")
Else
_letter = _letter.Replace("&SPA_EMAIL.EVAL", _dtEmailaddress(0)("email"))
End If
End IfI need to be able to check for email addresses that end with '@opd.org' in the reference called _dtEmailaddress(0)("email"). Thus can you show me the vb.net code so I would know how to use only email addresses that end with '@opd.org'?
-
In a vb.net 2010 application, I have the following code setup so far:
Dim _dtEmailaddress As DataTable = SelectEmailAddress(_dtPersonID(0)("SPA_PersonID"))
Dim _email As String = String.Empty
If _dtEmailaddress.Rows.Count > 0 Then
If IsDBNull((_dtEmailaddress(0)("email"))) Then
_letter = _letter.Replace("&SPA_EMAIL.EVAL", "")
Else
_letter = _letter.Replace("&SPA_EMAIL.EVAL", _dtEmailaddress(0)("email"))
End If
End IfI need to be able to check for email addresses that end with '@opd.org' in the reference called _dtEmailaddress(0)("email"). Thus can you show me the vb.net code so I would know how to use only email addresses that end with '@opd.org'?
-
In a vb.net 2010 application, I have the following code setup so far:
Dim _dtEmailaddress As DataTable = SelectEmailAddress(_dtPersonID(0)("SPA_PersonID"))
Dim _email As String = String.Empty
If _dtEmailaddress.Rows.Count > 0 Then
If IsDBNull((_dtEmailaddress(0)("email"))) Then
_letter = _letter.Replace("&SPA_EMAIL.EVAL", "")
Else
_letter = _letter.Replace("&SPA_EMAIL.EVAL", _dtEmailaddress(0)("email"))
End If
End IfI need to be able to check for email addresses that end with '@opd.org' in the reference called _dtEmailaddress(0)("email"). Thus can you show me the vb.net code so I would know how to use only email addresses that end with '@opd.org'?
In addition to Richard's answer... Becasue
_email
variable is type of string, you can use string functions, such as [EndsWith](https://msdn.microsoft.com/en-us/library/2333wewz(v=vs.110).aspx), [Contains](https://msdn.microsoft.com/en-us/library/dy85x1sa(v=vs.110).aspx), etc.If _email.EndsWith("@opd.org") Then
'here your code
End If -
In addition to Richard's answer... Becasue
_email
variable is type of string, you can use string functions, such as [EndsWith](https://msdn.microsoft.com/en-us/library/2333wewz(v=vs.110).aspx), [Contains](https://msdn.microsoft.com/en-us/library/dy85x1sa(v=vs.110).aspx), etc.If _email.EndsWith("@opd.org") Then
'here your code
End If