I am working on a project - students management system. I made UIs for all the forms, wrote some codes for other functions. The function I'm working on now has to read textboxes, comboboxes and insert into phpmyadmin database's table - studentsdata and after this the function has to read that table and insert it in datagridview. I already did first step - my function can read textboxes, comboboxes and all of this can be successfully inserted in database but now I don't what to do next, how to load data into gridview. Thanks for you answers!
It is the code where data comes to database.
Don't judge for my asking, i am new and i will learn how to properly make a post :)
private void btnSave_Click(object sender, EventArgs e)
foreach (Control obj in panel1.Controls)
if (obj is TextBox)
if (obj.Text == "")
MessageBox.Show("Action cannot be performed. All fields must to be filled up.", "Something is missing", MessageBoxButtons.OK, MessageBoxIcon.Error);
sql = "INSERT INTO `studentstable` VALUES ('" + txtName.Text + "', '" + txtLastName.Text + "', '" + comboBoxGender.Text + "', '" + comboBoxClass.Text + "')";
What I have tried:
I watched a lot of tutorials, but most of them are required libraries that I cannot use because of project's requirements. The hint my teacher gave me is that the simplest way to this would be using mysqladapter, is she right? If yes, how to start?
I don't need whole code, I need only start-up.