コード例 #1
0
                                   private DataTable Execute_SQL__select(cDBConnection dbconnections_in)
                                   {
                                       switch (dbconnections_in.DBServerType)
                                       {
                                       case eDBServerTypes.SQLServer:
                                       case eDBServerTypes.PostgreSQL: {
                                           return(dbconnections_in.Execute_SQLQuery_returnDataTable(string.Format(
                                                                                                        "select \"IDUser\", \"Login\", \"Password\" from \"User\" where \"Login\" = 'test-{0}'",
                                                                                                        testid_
                                                                                                        )));
                                       }

                                       default: {
                                           throw new Exception(
                                                     string.Format(
                                                         "unsuported db type: {0}",
                                                         dbconnections_in.DBServerType.ToString()
                                                         )
                                                     );
                                       }
                                       }
                                   }
コード例 #2
0
                                   public void TestFixtureSetUp()
                                   {
                                       testid_ = DateTime.Now.Ticks.ToString();// Guid.NewGuid().ToString();
                                       dbname_ = System.Configuration.ConfigurationSettings.AppSettings["DBName"];
                                       //---
                                       eDBServerTypes _dbtype;

                                       string[] _dbtypes = OGen.lib.datalayer.utils.DBServerTypes.Names_supportedForGeneration();
                                       dbconnections_ = new cDBConnection[_dbtypes.Length];
                                       for (int d = 0; d < _dbtypes.Length; d++)
                                       {
                                           _dbtype
                                               = OGen.lib.datalayer.utils.DBServerTypes.convert.FromName(_dbtypes[d]);

                                           dbconnections_[d] = new cDBConnection(
                                               _dbtype,
                                               System.Configuration.ConfigurationSettings.AppSettings[
                                                   string.Format("DBConnectionstring-{0}", _dbtypes[d])
                                               ]
                                               );
                                       }
                                   }
コード例 #3
0
                                   private void Execute_SQL__delete(cDBConnection dbconnections_in)
                                   {
                                       switch (dbconnections_in.DBServerType)
                                       {
                                       case eDBServerTypes.SQLServer:
                                       case eDBServerTypes.PostgreSQL: {
                                           dbconnections_in.Execute_SQLQuery(string.Format(
                                                                                 "delete from \"User\" where \"Login\" = 'test-{0}'",
                                                                                 testid_
                                                                                 ));
                                           break;
                                       }

                                       default: {
                                           throw new Exception(
                                                     string.Format(
                                                         "unsuported db type: {0}",
                                                         dbconnections_in.DBServerType.ToString()
                                                         )
                                                     );
                                       }
                                       }
                                   }
コード例 #4
0
                                   private void Execute_SQL__insert(cDBConnection dbconnections_in)
                                   {
                                       switch (dbconnections_in.DBServerType)
                                       {
                                       case eDBServerTypes.SQLServer:
                                       case eDBServerTypes.PostgreSQL: {
                                           dbconnections_in.Execute_SQLQuery(string.Format(
                                                                                 "insert into \"User\" (\"Login\", \"Password\") values ('test-{0}', 'password')",
                                                                                 testid_
                                                                                 ));
                                           break;
                                       }

                                       default: {
                                           throw new Exception(
                                                     string.Format(
                                                         "unsuported db type: {0}",
                                                         dbconnections_in.DBServerType.ToString()
                                                         )
                                                     );
                                       }
                                       }
                                   }
コード例 #5
0
 internal cDBTransaction(cDBConnection parent_ref_in)
 {
     parent_ref_    = parent_ref_in;
     intransaction_ = false;
 }