[C# & SQL] Problem, once again.

Skilled Illusionist
Joined
Jul 1, 2007
Messages
367
Reaction score
1
Back again, with the same problem, but I've gotten further to success :).

Code:
        private void button10_Click(object sender, EventArgs e)
        {
            StreamReader Lpw = new StreamReader(MySQL.RunMySQLQuery("SELECT * FROM users WHERE Username=`" + textBox1.Text + "`", "Password"));
            txtPass.Text = Lpw.ReadToEnd();
            Lpw.Close();
        }

If you know C#, along with SQL, you'd know what I'm trying to do.
But for some reason I get an error.

Visual C# Studio :: Error said:
The best overload for "StreamReader" has some invalid arguments.

Im clueless :confused:
 
MySQL.RunMySQLQuery("SELECT * FROM users WHERE Username=`" + textBox1.Text + "`", "Password")

Aside from the syntax error in the query, This statement "MySQL.RunMySQLQuery" returns a resultset, their is no StreamReader constructor that takes a resultset as an argument.

Go check the constructors for the StreamReader class.

I know this is criptic, but in the long run its going to help you the best.

Kind Regards
 
Back