title: Object returning from Function vb.net
body: <p>I'm trying to return an object from a function.</p>
  
  <p>E.g. Ive got a function populateDog that returns Dog</p>
  
  <p>So in my aspx class I want to be able to be able to pass in Lassie as the name of the dog(I have a dog class) and have the function return the object with the data it populated.</p>
  
  <p>So that in my aspx class i can go lassie.color, lassie.breed</p>
  
  <p>Main Goal is: lbl.txt = Lassie.Color</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>Public Function populateDog(ByVal dName As String) As dog
          dbConnection()
          Dim ObjDog As New dog(dName)
          ObjDog.sBreed = "Collie"
          Return ObjDog
      End Function
  </code></pre>
  
  <p>The idea was to have a database and I would eventually pass in an ID to query results and return it. For now though I just wanna get this understanding and move forward. </p>