Beispiel #1
0
        public void Init()
        {
            sqlHelper = new DapperSqlServerOperator(@"Server=DESKTOP-T36VH59;Database=Sample;uid=sa;pwd=sasa;");
            sqlHelper.ExecuteNonQuery("DELETE [dbo].[Person]");
            string _sql = @"INSERT INTO [dbo].[Person]
               ([ID]
               ,[UserName]
               ,[Address]
               ,[Age]
               ,[Password]
               ,[RegisterDate])
             VALUES
               (@ID
               ,@UserName
               ,@Address
               ,@Age
               ,@Password
               ,@RegisterDate)";

            for (int i = 0; i < 10; i++)
            {
                Person _person = new Person();
                _person.Address      = RandomHelper.NextHexString(10);
                _person.Age          = (byte)i;
                _person.ID           = Guid.NewGuid().ToString();
                _person.UserName     = RandomHelper.NextHexString(10);
                _person.Password     = RandomHelper.NextHexString(10);
                _person.RegisterDate = RandomHelper.NextDateTime();
                sqlHelper.ExecuteNonQuery <Person>(_sql, _person);
            }
        }
 public void Init()
 {
     sqlHelper = new DapperSqlServerOperator(@"Server=YANZHIWEI-PC\SQLEXPRESS;Database=Sample;uid=sa;pwd=sasa;");
 }
        public void Init()
        {
            string _connectString = @"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.102.2.165)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=LC)));User Id=user01;Password=Orcl_4321;";

            OralceHelper = new DapperOracleOperator(_connectString);
        }