Passing the result of sql query to variables
<p>I am just starting to learn C# and this is my very first request for help.</p>

<p>I have written a log-in script which has the usual "username" and "password" fields plus submit button.</p>

<p>The script queries a MySQL data table and if the username and password match closes the log-in window and opens a detail window.</p>

<p>What I am trying to do is use two of the fields from the query and pass the content to the detail window for display. This is the code so far:</p>

<pre><code>MySqlCommand SelectCommand = new MySqlCommand(
"SELECT clientID, login, pass, name_f, 
name_l FROM FIDS_members WHERE login = '" + 
this.username_txt.Text + "' AND pass = '" + 
this.pass_txt.Text + "';", myConn);

            MySqlDataReader myReader;
            myConn.Open();

            myReader = SelectCommand.ExecuteReader();

            int count = 0;


            while (myReader.Read())
            {

                count = count + 1;
            }

            if (count == 1)
            {

                string name_f = myReader.GetString("name_f").ToString();
                name_f_txt = name_f;

                this.Hide();
                Welcome f2 = new Welcome(name_f.Text);
                f2.ShowDialog();
            }
            else

                MessageBox.Show("The username or password are incorrect, please try again...");


           // Clear login feilds
            username_txt.Text = String.Empty;
            pass_txt.Text = String.Empty;
</code></pre>

<p>The error I am getting is:</p>

<p><em>"string does not contain a definition for "Text".</em></p>

<p>I am aware that I may not be doing this correctly but if someone could please provide some pointers it would be very helpful.</p>
