_cust.Clear();but i'm not sure which is best, load an xml in the dataset or replace the existing dataset and redo the bindings. It comes up tho the same result but what is more effective ?
AR_CustMaster cust = new AR_CustMaster(3, 0, false); QueryResult res = cust.Query(custNo); if (_cust !=null) { _cust.Clear(); StringBuilder sb = new StringBuilder(); System.IO.StringWriter sw = new StringWriter(sb); res.queryResult.WriteXml(sw); StringReader sr = new StringReader(sb.ToString()); _cust.ReadXml(sr, XmlReadMode.InferSchema); _cust.AcceptChanges(); } else { _cust = res.queryResult as AR_CustMaster; this.SetBindings(); }-- OR --
AR_CustMaster cust = new AR_CustMaster(3, 0, false); QueryResult res = cust.Query(custNo); _cust = res.queryResult as AR_CustMaster; this.SetBindings();