Database layer abstract factory update 1 - multi-table connection condition query operation

xiaoxiao2021-03-06  75

For the case of returning a single table DataSet in Select, the method has been overloaded, using the most common INNERJOIN connection to return multi-table data related information link: Database layer abstract factory solution archive [continuous upgrade] Database layer abstract factory update 1-- Multi-table connection condition query operation ///

/// Multi-table connection condition query operation /// /// Table name group /// column name group /// condition /// conditional query results public static DataSet Select (string [] strTableName, string [] strColumn, string strCondition) {DataSet ds = new DataSet (); Factory factory = Factory.GetInstance (); abstractDbFactory abstractDbFactory = factory.CreateInstance (); IDbConnection concreteDbConn = abstractDbFactory.CreateConnection ( ); concreteDbConn.ConnectionString = abstractDbFactory.GetConnectionString (); concreteDbConn.Open (); IDbCommand concreteDbCommand = abstractDbFactory.CreateCommand (); IDbTransaction concreteDbTrans = abstractDbFactory.CreateTransaction (concreteDbConn); concreteDbCommand.Connection = concreteDbConn; concreteDbCommand.Transaction = concreteDbTrans; IDbDataAdapter concreteDbAdapter = abstractDbFactory.CreateDataAdapter (); try {string strSql = "SELECT"; for (int i = 0; i

For (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-108037.html

New Post(0)