public virtual int FillByWhereClause(Product.ProductsDataTable dataTable, string whereClause, System.Data.OleDb.OleDbParameter[] parameters) { System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand(); command.Connection = this.Connection; command.CommandText = "SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice" + ", UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued, CreateID, CreateUser, " + "ModifyID, ModifyUser FROM Products " + whereClause + ";"; command.CommandType = System.Data.CommandType.Text; if (null != parameters) { command.Parameters.AddRange(parameters); } this.Adapter.SelectCommand = command; if ((this.ClearBeforeFill == true)) { dataTable.Clear(); } int returnValue = this.Adapter.Fill(dataTable); return(returnValue); }
public virtual Product.ProductsDataTable GetDataBy(int ProductID) { this.Adapter.SelectCommand = this.CommandCollection[1]; this.Adapter.SelectCommand.Parameters[0].Value = ((int)(ProductID)); Product.ProductsDataTable dataTable = new Product.ProductsDataTable(); this.Adapter.Fill(dataTable); return dataTable; }
public virtual Product.ProductsDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; Product.ProductsDataTable dataTable = new Product.ProductsDataTable(); this.Adapter.Fill(dataTable); return dataTable; }