JasonD
Member
Application Overview
My application is an account and character manager for a game, it uses MySQL's ODBC driver to communicate with the server.
Now, I didn't use the best of my knowledge when doing the queries, as every query requires a reconnection to the server.
The way I designed it was, when the user "connects", it just checks if the connection to the server is possible at the time, then saves the connection details in variables so other forms can access them.
What I should have done
I should have created an actual connection and used constructors to access it as a connection instead of reconnecting, but I do not know how to use constructors in Visual Basic .NET.
My Question
How do you work constructors in Visual Basic .NET? And how would you access them from other forms.
Going by C# to access it would be something (interpreted) like
Correct?
The connection
Thanks in advance for any help
My application is an account and character manager for a game, it uses MySQL's ODBC driver to communicate with the server.
Now, I didn't use the best of my knowledge when doing the queries, as every query requires a reconnection to the server.
The way I designed it was, when the user "connects", it just checks if the connection to the server is possible at the time, then saves the connection details in variables so other forms can access them.
What I should have done
I should have created an actual connection and used constructors to access it as a connection instead of reconnecting, but I do not know how to use constructors in Visual Basic .NET.
My Question
How do you work constructors in Visual Basic .NET? And how would you access them from other forms.
Going by C# to access it would be something (interpreted) like
VB.NET:
Dim Connection As New Form1.SavedConnection
The connection
VB.NET:
Dim SQL As New Odbc.OdbcConnection(Connection_String)
Thanks in advance for any help