.net MySQL/ MariaDB Class

08/30/2017 12:48 ecks de#1
VB.NET:
C#:

You need this MySQL Connector:
[Only registered and activated users can see links. Click Here To Register...]
08/31/2017 19:14 Serraniel#2
I just have checked the C# code but I assume the VB.Net may work the same. So here is some feedback about several issues I noticed by quickly scanning your code:

1: In sense to use this class as a MySQL wrapper you should be able to pass the connection data through the constructor and building the connection string dynamically instead of defining them during compile time and using the pre defined connection string.

2: Do not catch an exception and show a message box with the error in a class you may want to spread. In general, this type of error handling belongs to the developer who wants to use your lib.

3: Same for the query as for the constructor. Pass the query as parameter so it can be used for any query.

4: Instead of the closeConnection you should implement [Only registered and activated users can see links. Click Here To Register...] interface.
08/31/2017 23:33 ecks de#3
Quote:
Originally Posted by Serraniel View Post
I just have checked the C# code but I assume the VB.Net may work the same. So here is some feedback about several issues I noticed by quickly scanning your code:

1: In sense to use this class as a MySQL wrapper you should be able to pass the connection data through the constructor and building the connection string dynamically instead of defining them during compile time and using the pre defined connection string.

2: Do not catch an exception and show a message box with the error in a class you may want to spread. In general, this type of error handling belongs to the developer who wants to use your lib.

3: Same for the query as for the constructor. Pass the query as parameter so it can be used for any query.

4: Instead of the closeConnection you should implement [Only registered and activated users can see links. Click Here To Register...] interface.
Ye thanks, that is actually an old version. handling exceptions and printing them is pretty bad i know, but it was for testing purporse only xd. thanks for feedback!
09/10/2017 07:58 atom0s#4
This is fairly pointless/useless, to be honest. Your class does not offer any real useful features or expand off the already available features of the MySQL connector itself. There are several errors with your code as well, such as returning a value in a void function.