コード例 #1
0
ファイル: Form1.cs プロジェクト: yufc/rabbitmq-test
        private void Button7_Click(object sender, EventArgs e)
        {
            DapperPlusManager.AddLicense("974;700-IRDEVELOPERS.COM", "FB90FB42600315DC035C24AADC7A6495D213");
            DapperPlusManager.Entity <TableLog>().Table("TableLog");

            string oracleStr       = "User Id=smart;Password=smart;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=121.40.101.29)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl)))";
            string oracleDevartStr = "User Id=smart;Password=smart;Server=121.40.101.29;Direct=True;Sid=orcl;";

//            using (var connection = new SqlConnection("Data Source=121.40.101.29;Initial Catalog=scm_main;Integrated Security=False;Password=sa123;Persist Security Info=True;User ID=sa"))
//            using (var connection = new OracleConnection("User Id=smart;Password=smart;Server=121.40.101.29;Direct=True;Sid=orcl;"))
            using (var connection = new OracleConnection(oracleStr))
            {
                var tableLog = new TableLog();
                tableLog.tableName  = "aaa";
                tableLog.createTime = DateTime.Now;

                connection.BulkInsert(new List <bd_TableLog>()
                {
                    new bd_TableLog()
                    {
                        tableName = "ExampleBulkInsert", createTime = DateTime.Now
                    }
                });
            }


//            using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
//            {
//                var customer = connection.Query<Customer>("Select * FROM CUSTOMERS WHERE CustomerName = 'ExampleBulkInsert'").ToList();
//
//                Console.WriteLine("Row Insert : " + customer.Count());
//
//                FiddleHelper.WriteTable(connection.Query<Customer>("Select TOP 10 * FROM CUSTOMERS WHERE CustomerName = 'ExampleBulkInsert'").ToList());
//            }
        }