Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult ConnectionTest()
- {
- List<String> shopping_carts = new List<string>();// change data type to model (not yet created)
- string sql = " SELECT * FROM shopping_cart ";
- var connectionConfig = new DB.MySqlConfig();
- MySqlConnection con = new MySqlConnection(connectionConfig.getConfig());
- var cmd = new MySqlCommand(sql, con);
- con.Open();
- MySqlDataReader reader = cmd.ExecuteReader();
- while (reader.Read())
- {
- shopping_carts.Add(Convert.ToString(reader["total_price"]));
- }
- return View();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement