Going off of OutsidetTheBox, try this; instead of private, which can't be accessed; try public in the struct.
Imports MySql.Data.MySqlClient
Public Class companyPersistor
Dim M_con As New MySqlConnection
Dim oCommand As New MySqlCommand
Shared M_Persistor As companyPersistor
Private Sub New()
End Sub
Shared Function GetPersistor() As companyPersistor
If M_Persistor Is Nothing Then
M_Persistor = New companyPersistor
M_Persistor.connect()
End If
Return M_Persistor
End Function
Private Sub connect()
If M_con.State = ConnectionState.Closed Then
M_con.ConnectionString = "server= localhost ; user id=newuser; database='indproj'"
M_con.Open()
End If
End Sub
Private Sub disconnect()
M_con.Close()
End Sub
Public Sub InsertCompany(ByVal p_company As company)
connect()
Dim oCommand As New MySqlCommand
oCommand.Connection = M_con
oCommand.CommandText = "insert into company (CompanyName, street, city, zipcode,phonenumber) values('" & p_company.CompanyName & "', '" & p_company.city & "', '" & p_company.zipcode & "', '" & p_company.state & "', '" & p_company.phonenumber & "')"
oCommand.ExecuteNonQuery()
End Sub
Structure company
Public CompanyName As String
Public city As String
Public zipcode As Integer
Public state As String
Public phonenumber As String
End Structure
End Class