0

Hey, The main theme is that im using MYSQL, not SQL Server.

i have few different win forms, which are used to login, and the other is loading screen. In the loading screen i have indicators, which appears when something is bad, or good. I mean, green indicator shows up, when you connected to MYSQL, and the other red indicator shows up when you are not connected. Should i also write any MYSQL code on the form which loads the app? Also at the loading form, i don't have any mysql scripts, i mean i did the login/register at the login form. How could i "move" the scripts, to show up at the other form? Or maybe there is just an easy example. How could i make the code which checks, if the connection with MYSQL, is correct. I Mean there should be a label, and the code like writes : Susccesfully connected to MYSQL, the other is NOT connected to MYSQL. Also today, im just started to learn MYSQL, i don't have any ideas, how could i do this, it would be also great if any of you post me any good links, where i could learn MYSQL. Code which is used to login to MYSQL DB, in the login form.

server = "localhost";
        database = "vartotojai";
        uid = "root";
        password = "";


        string connString;
        connString = $"SERVER={server};DATABASE={database};UID={uid};PASSWORD={password};";
        conn = new MySqlConnection(connString);
4
  • "im using MYSQL, not SQL": Do you know the difference between mysql and sql? Commented Aug 29, 2018 at 11:08
  • Welcome to stackoverflow. Please edit your question in regards to indention of your code, grammar, spelling and punctuation. Make it as simple as possible for other people to read through and understand your text, even if they are not a native speaker. Commented Aug 29, 2018 at 11:09
  • StackOverflow is a Q&A site, where you ask one question at the time (so it functions as a reference for future people asking the same question). The main question in your post is "how do I check MySql connection state", which has already been answered here: stackoverflow.com/questions/20785220/…. Commented Aug 29, 2018 at 11:27
  • 1
    Possible duplicate of How to check MySQL connection state in C# Commented Aug 29, 2018 at 11:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.