>protected override mmDataSet CreateDataSet() >{ > return new MyDataSet(); >}Okay, I put that in my class. Then do I still put in the "GetVendors" method you demonstrated earlier in this thread:
public DataSet GetVendors() { // Pass whatever parameters you need here, or call FillDataSet // if you have an existing ds you want to fill return this.GetDataSet(); }I tried adding your version of GetVendors to my class, but it doesn't compile, because none of the overloads for GetDataSet take zero parameters, which is the way you've got the method coded.
using System; using System.Data; using OakLeaf.MM.Main.Business; using OakLeaf.MM.Main.Data; namespace MyCo.WarehouseSystem.Business { public class Vendor : ABusinessObject { public Vendor() { this.TableName = "Vendor"; this.PrimaryKey = "VendorNo"; this.RetrieveAutoIncrementPK = false; } protected override mmDataAccessBase CreateDataAccessObject(string dataAccessClassName) { return new VendorDataAccessSql(); } protected override mmDataSet CreateDataSet() { return new VendorDataSet(); } public override DataSet GetEmptyDataSet() { return new VendorDataSet(); } public DataSet GetVendors() { return this.GetDataSet(); } protected override mmBusinessRule CreateBusinessRuleObject() { return new VendorRules(this); } protected override void HookSetDefaultValues(DataRow dataRow) { dataRow["Address"] = String.Empty; dataRow["Address2"] = String.Empty; dataRow["City"] = String.Empty; dataRow["State"] = String.Empty; dataRow["ZipCode"] = String.Empty; dataRow["Phone"] = String.Empty; dataRow["Fax"] = String.Empty; } protected override bool HookPreSave(DataTable dt) { foreach(DataRow dr in dt.Rows) { dr["VendorNo"] = dr["VendorNo"].ToString().Trim().ToUpper(); } return true; } } }