Forum Discussion
Former_Member
9 years agoIdeator I
HI,
You can try it.
Server Event :OnGet
Innovator innovator = this.getInnovator();
ArasTool aras = new ArasTool(innovator);
string queryString = "select cname from customer";
string dbConn = "XXX";
Item res5 = null;
Item res = this.getInnovator().newResult("");
try
{
XmlElement resultNd = (XmlElement) res.dom.SelectSingleNode("/*/*/*");
DataTable dt = aras.getDataTable(dbConn,queryString);
foreach (DataRow dr in dt.Rows){
res5 = this.newItem("customer");
string newid = getNewID();
res5.setID(newid);
res5 = res5.apply();
res5.setProperty("_cname",dr["cname"].ToString());
resultNd.AppendChild(resultNd.OwnerDocument.ImportNode(res5.node, true));
}
} catch (Exception ex) {
CCO.Utilities.WriteDebug("DebugFile",ex.ToString());
}
return res;