Passing variable values in ASP.NET and Mysql [closed]

-1
Hello, I'm developing a page in asp.net and I'm having difficulty passing values from a SELECT from Mysql to variables. I do not know where to start and would appreciate examples of how to do it.

    
asked by anonymous 02.08.2016 / 18:29

2 answers

0
            MySqlConnection con = new MySqlConnection("caminho da base de dados");
            MySqlCommand cmd = new MySqlCommand();
            cmd.Connection = con;
            con.Open();
            cmd.CommandType = CommandType.Text;
            string fu = "SELECT* FROM Tb_Banco where id=2";
            cmd.CommandText = fu;
            MySqlDataReader R;
            R = cmd.ExecuteReader();
            R.Read();

            string Conta_Banco = R["Conta"].ToString();
            string Nome_Banco = R["Banco"].ToString();
    
02.08.2016 / 19:01
0

This question is almost a How To, so there goes a link to base it on, as we do not know how to deepen your knowledge, I leave this how to basic:

Connecting C # to MySQL

I also suggest that you try to learn Entity Framework!

    
02.08.2016 / 19:00