terrydiederich2
1/10/2019 - 3:17 PM

Database Get All Table

Public Function GetAllTable(_includeRetired As Boolean) As DataTable
  Dim db As New dbFunctions
  Dim table As New DataTable
  Dim myAdapter As New MySqlDataAdapter
  Dim retired As Integer = 0

  If _includeRetired = True Then retired = 1

  Dim constr As String = MyConnectionString
  Using con As New MySqlConnection(constr)
    Using cmd As New MySqlCommand("Customers_GetAll", con)
    cmd.CommandType = CommandType.StoredProcedure
    cmd.Parameters.AddWithValue("@_includeRetired", retired)

    myAdapter.SelectCommand = cmd
    myAdapter.Fill(table)

  End Using
End Using

Return table
End Function