Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Creating a registration form, getting error saying 'database.table' does not exist

$
0
0

Hi, I am creating a registration form using visual studio 2012 and cannont connect my database to my form. Here is my code:

private void Register_Click(object sender, EventArgs e)
        {
                string constring = "datasource=127.0.0.1;port=3306;username=root;password=welcome";
                string Query="insert into userInfo.users (userid, email, passone, passtwo, lastname, firstname, currentDate) values('"+this.userid_txt.Text+"','"+this.email_txt.Text+"','"+this.passone_txt.Text+"','"+this.passtwo_txt.Text+"','"+this.lastname_txt.Text+"','"+this.firstname_txt.Text+"','"+this.date_txt.Text+"') ;";
                MySqlConnection conDataBase=new MySqlConnection(constring);
                MySqlCommand cmdDataBase = new MySqlCommand(Query, conDataBase);
                MySqlDataReader myReader;
                try {
                    conDataBase.Open();
                    myReader=cmdDataBase.ExecuteReader();
                    MessageBox.Show("Welcome to iDSTEM!");
                    while(myReader.Read()) {

                    }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
The error says Table'database.users' doesn't exist, any ideas?

Here is a picture of my Data table info.

 I appreciate any help, once this is done I should be finished so I can graduate next week =)

Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>