Public feed #527695

piph

public text v1 · immutable
Raw Edit
·published 2007-06-01 12:07 UTC
rendered paste body
    
//In the datalogic.class:

public static MySqlDataReader GetShows(string artist)
    {

        string sql = "SELECT LOWER(country) as country,city,event,date,artist FROM shows";

        MySqlConnection connection = ConnectionManager.GetMySqlConnection();
        MySqlCommand command = new MySqlCommand(sql, connection);
        command.CommandType = CommandType.Text;

        MySqlDataReader reader = command.ExecuteReader(CommandBehavior.SingleResult | CommandBehavior.CloseConnection);
        return reader;
    }


//In the aspx.cs-file:


        MySqlDataReader dr = DataLogic.GetShows("theartist");
        GridView1.DataSource = dr;
        GridView1.DataBind();