DataTableGetRowCount

 

Gets the number of ROWs in a DataTable object.

 

int @DataTableGetRowCount(object datatable);

 

Parameters

object datatable: The DataTable object.

 

Return Value

Returns the number of ROWs.

 

Example

connection_id = @ProxyMongoOpen("mongodb://192.168.1.149", "test");
if (connection_id == 0)
{
   @Message("Error. connection_id == 0");
   return;
}

string text;
@sprintf(text, "{PersonCount:50}");
string sort;
@sprintf(sort, "{_id:1}");

object dt;
dt = @ProxyMongoFill(connection_id, "things", text, sort);
@ProxyMongoClose(connection_id);
if (dt == null)
{
   @MessageBox(@GetLastError(), "MongoFill Error", MB_OK);
   return;
}

int count;
count = @DataTableGetRowCount(dt);

if (count > 0) {
   string data = @DataTableGetRowData(dt, "PersonDate", 0);
   string id = @DataTableGetRowData(dt, "_id", 0);
   @sprintf(text, "Count=%d _id=%s, PersonDate=%s", count, id, data);
   @Message(text);
}
else {
   @sprintf(text, "Count=%d", count);
   @Message(text);
}

@DataGridSetDataTable("DataGrid1", dt);
@DataGridReLoad("DataGrid1");

 

Description: Example of opening and using the test database on IP address 192.168.1.149

 

Version Information

Supported Version: 10.3.5 or Higher

 

Related Helps

@DataTableGetRowCount()

@DataTableGetRowData()