public DataItem getRow(Command cmd, DbTran transaction)
{
DataItem row = new DataItem();
try {
reader = query(cmd, transaction);
if (reader.Read())
{
int len = reader.FieldCount;
for (int i = 0; i < len; i++)
{
row.set(reader.GetName(i), reader[i]);
}
}
if (row.count() > 0)
{
return(row);
}
else
{
return(null);
}
}
catch (Exception ex) {
WeedConfig.logException(cmd, ex);
throw ex;
}
finally {
tryClose();
}
}