V
Vagabond Software
I'm at a complete loss on this problem. I'm using a DataColumn Expression with the DataTable Select method to return rows matching a data. Rows are returned on my Windows XP Professional computer at home, but no rows are found on the client's Windows 2000 computers.
I have checked the regional settings' date format on both machines, and they are identical. The expression used in both locations are identical, and the data used in both locations are identical.
Here is the code:
01: string expr = "FileName LIKE '" + pattern + "*'";
02: string latestFileDate;
03: latestFileDate = dtFiles.Compute("MAX(LastModified)", expr).ToString();
04: expr = expr + " AND LastModified = #" + latestFileDate + "#";
05: DataRow[] foundRows = dtFiles.Select(expr);
06: string latestFile = foundRows[0]["FullPath"].ToString();
DataTable dtFiles contains a list of files with information in four columns; FileName, FileSize, LastModified, and FullFilename (includes path). Let's say the files are all files with the ".log" extension. Let's say string pattern equals "KB".
String expr is first used on line 03 to obtain the last date and time any log file beginning with "KB" was modified.
On line 04, I append the computed date and time onto String expr as an additional filter on the LastModified column.
Line 05 ALWAYS returns one row at home, on Windows XP, but no rows are returned on the client's Windows 2000 computers. String expr is identical on Line 04, on both computers.
Any help is greatly appreciated.
- carl
I have checked the regional settings' date format on both machines, and they are identical. The expression used in both locations are identical, and the data used in both locations are identical.
Here is the code:
01: string expr = "FileName LIKE '" + pattern + "*'";
02: string latestFileDate;
03: latestFileDate = dtFiles.Compute("MAX(LastModified)", expr).ToString();
04: expr = expr + " AND LastModified = #" + latestFileDate + "#";
05: DataRow[] foundRows = dtFiles.Select(expr);
06: string latestFile = foundRows[0]["FullPath"].ToString();
DataTable dtFiles contains a list of files with information in four columns; FileName, FileSize, LastModified, and FullFilename (includes path). Let's say the files are all files with the ".log" extension. Let's say string pattern equals "KB".
String expr is first used on line 03 to obtain the last date and time any log file beginning with "KB" was modified.
On line 04, I append the computed date and time onto String expr as an additional filter on the LastModified column.
Line 05 ALWAYS returns one row at home, on Windows XP, but no rows are returned on the client's Windows 2000 computers. String expr is identical on Line 04, on both computers.
Any help is greatly appreciated.
- carl