title: Pass multiple Value to class from function
body: <p>i have 2 class 1 is get ms access data and another class for sql acsess.
  i want to pass acsess class function value to sql class and assign it to sql class varible.curruntly i can assign only 1 varible.</p>
  
  <pre><code>Public Class connectionclass
  Dim provider As String = "provider=Microsoft.ACE.OLEDB.12.0;data source=|DataDirectory|"
  Dim database As String = "serverdata.accdb"
  Public connstring As String = provider &amp; database
  Public myconnection As New OleDbConnection(connstring)
  Public Function data1()
      Dim x As String
      Dim y As String
      Dim u As String
      Dim p As String
      Try
          myconnection.Open()
          Dim getdata As New OleDbCommand("select * from server", myconnection)
          Dim reader As OleDbDataReader = getdata.ExecuteReader
          While reader.Read
              x = reader.Item("sname")
              y = reader.Item("dbase")
              u = reader.Item("username")
              p = reader.Item("password")
              Return (x)
          End While
          myconnection.Close()
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Function
  </code></pre>
  
  <p>End Class</p>
  
  <p>2nd class</p>
  
  <pre><code>ublic Class datbaseconnect
  Public obj1 As New connectionclass
  Dim returnvalue As String
  Dim X = obj1.data1
  Dim y = ""
  Dim u = ""
  Dim p = ""
  Public SQLCon As New SqlConnection With
    {.ConnectionString =
    "Server=" &amp; x &amp; ";
      DataBase=" &amp; y &amp; ";
      user ID=" &amp; u &amp; ";
      password=" &amp; p &amp; ";
      Trusted_Connection=false;
  "}
  
  End Class
  </code></pre>