mysql - Displaying values from table in VS2013 forms -


i have created login form, checks database username , password provided, , if username exists logs in , transfer next form says: "welcome 'username' " . now, want show other info table person loggs in recorded in database. here code, been struggling it, don't know change make work, i'm getting errors cmd , reader saying don't exist in current context.

    private void populatefields()     {         string constring = (@"data source=(localdb)\v11.0;attachdbfilename=c:\users\slame\onedrive\dokumenti\relacijska_baza_podataka.mdf;integrated security=true;connect timeout=30;");         sqlconnection con = new sqlconnection(constring);          string selectsql = "select * pending_tasks";         sqlcommand com = new sqlcommand ("select * student username='" + textbox3.text + "' , password ='" + textbox4.text + "'", con);          try        {            con.open();             using (sqldatareader read = cmd.executereader())            {                while(reader.read())             {                 textbox3.text = (read["username"].tostring());                 textbox4.text = (read["password"].tostring());             }                     }            }            {       con.close(); } 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -