I'm doing a lab for school, and I came across something I have never done before: create a default constructor within my class. It involves creating a private field to store the connection string, then create a default constructor that sets the connection string.
Here is what I have so far:
Public Class Appointments
Private sqlconnection As String = ConfigurationSettings.AppSettings("ConnectionString")
Private Property connectionstring() As String
Get
Return sqlconnection
End Get
Set(ByVal value As String)
End Set
End Property
Public Sub New(ByVal sConnectionString As String)
sqlconnection = sConnectionString
End Sub
Am i doing this right? What the heck is going on?. Please help a noob out.