How can i use the input received from a textbox in Form1 to make a connection with mySQL in form2. Now my program is like this:
Form1 opens and asks for Server, Username, Password. There are 3 buttons that will open different forms using form2 module, in form2 is the SQL connection string.
I have right now this at the connection string in form2:
Public Const cnString As String = "datasource=" & DBSelector.txtServer.Text & ";" _
& "username=" & DBSelector.txtUsername.Text & ";" _
& "password=" & DBSelector.txtPassword.Text & ";" _
& "database=" & DBSelector.txtDatabase.Text & ";"
Now im stuck with this error: "Reference to a non-shared member requires an object reference." I'm new with Visual Basic, and i cant fix the problem. I think its because Form2 is a module and not a Public Class.
I hope someone can help me. Thanks in Advance!