Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. vb.net edit

vb.net edit

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestionworkspace
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dcof
    wrote on last edited by
    #1

    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 If

    I 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'?

    L M 2 Replies Last reply
    0
    • D dcof

      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 If

      I 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'?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Pull the email address from the relevant field and check for the address you want to test against.

      1 Reply Last reply
      0
      • D dcof

        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 If

        I 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'?

        M Offline
        M Offline
        Maciej Los
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • M Maciej Los

          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

          D Offline
          D Offline
          dcof
          wrote on last edited by
          #4

          Thanks! That answers my question!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups