I have this peace of code that I am working on and I would like to get the record count data returned by this querrey bellow.
SELECT COUNT( *) AS 'TotalGeofence'
FROM GeofenceData
WHERE (DeviceUID = @DeviceUID AND
Time BETWEEN @StartTime AND @EndTime)
I then used this C# implementation to get the count and it is not working.
protected Int32 TotalGeofenceLocate()
{
int MonthlyFenceCount = 0;
Int32 DeviceUID = 227;
DateTime FromDate = new DateTime(StartingDate.Year, StartingDate.Month, 23);
DateTime EndingDate = new DateTime(StartingDate.Year, StartingDate.Month, 22);
GeofenceDataTableAdapter TotalFenceLocate = new GeofenceDataTableAdapter();
JeanPierre.GeofenceDataDataTable GeofenceDataTable = TotalFenceLocate.GetGeofenceCountByDeviceUIDTime(DeviceUID, FromDate, EndingDate);
foreach (JeanPierre.GeofenceDataRow FenceRows in GeofenceDataTable)
{
MonthlyFenceCount = Convert.ToInt32(FenceRows....);
}
//MonthlyFenceCount = GeofenceDataTable.Rows.Count;
return (MonthlyFenceCount);
}
Can anyone help me with this one?