Exemplo n.º 1
0
        private void Button5_Click(object sender, EventArgs e)
        {
            string sqlUserRole = "SELECT * FROM SMART_BD_USERROLE";

//            string sqlOrderDetail = "SELECT * FROM OrderDetails WHERE OrderDetailID = @OrderDetailID;";
//            string sqlCustomerInsert = "INSERT INTO Customers (CustomerName) Values (@CustomerName);";


            using (var connection = new UniConnection("provider=Oracle;User Id=smart;Password=smart;Server=121.40.101.29;Direct=True;Port=1521;Sid=orcl;"))
            {
                var orderDetails = connection.Query <UserRole>(sqlUserRole).ToList();
//                var orderDetail = connection.QueryFirstOrDefault<OrderDetail>(sqlOrderDetail, new { OrderDetailID = 1 });
//                var affectedRows = connection.Execute(sqlCustomerInsert, new { CustomerName = "Mark" });
//
//                Console.WriteLine(orderDetails.Count);
//                Console.WriteLine(affectedRows);
//
//                FiddleHelper.WriteTable(orderDetails);
//                FiddleHelper.WriteTable(new List<OrderDetail>() { orderDetail });
            }
        }