473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Select method returns rows on XP, but not Win2K?

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
Nov 16 '05 #1
2 1902
If my following suggestion works for you, please let me know. I was having a
similar problem. If it works for you, you'll no doubt be as confused as I was
when it worked for me.

Before line 05, insert the following as a new line:

dtFiles.Select("FileName = '1' ")

OK, as you can see, this line of code effectively does NOTHING meaningful to
the overall output. But run it and let me know if line 05 returns the correct
info now.

Good Luck! (It worked for me... but don't ask me why.)
"Vagabond Software" wrote:
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

Nov 16 '05 #2
Unfortunately, that did not fix the problem. Thank you for your suggestion. I am willing to try anything at this point.

- carl

"Tom Markham" <To********@discussions.microsoft.com> wrote in message news:74**********************************@microsof t.com...
If my following suggestion works for you, please let me know. I was having a
similar problem. If it works for you, you'll no doubt be as confused as I was
when it worked for me.

Before line 05, insert the following as a new line:

dtFiles.Select("FileName = '1' ")

OK, as you can see, this line of code effectively does NOTHING meaningful to
the overall output. But run it and let me know if line 05 returns the correct
info now.

Good Luck! (It worked for me... but don't ask me why.)


"Vagabond Software" wrote:
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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: skidvd | last post by:
Hello: I have just recently converted to using the InnoDB table type so that I can enforce FOREIGN key constraints. I have been using MyISAM tables (accessed via JDBC) successfully for some...
0
by: Vagabond Software | last post by:
I posted this problem earlier and now have more information. I use the DataTable Select method to get find the most recent "LastModified" date in a table of similarly named files. I then use the...
4
by: VK | last post by:
Hello, I have a dataset which has one datatable in it. The dt has over 3000 rows in it. Now I would like to get the rows where the StartDate is 15 Feb 2005, so I did the following: ...
1
by: Amjad | last post by:
Hi, I have written a program that reads certain rows from a table in a local JET database file. I use SQL strings to select the rows that I want to read. Everything works fine on my development...
4
by: Ed L. | last post by:
I think I'm seeing table-level lock contention in the following function when I have many different concurrent callers, each with mutually distinct values for $1. Is there a way to reimplement...
4
by: Aryan | last post by:
Hi, I am having problem with DataTable.Select() method. I am using ASP.NET 2.0. I have DataSet which reads data from XML file using DataSet.ReadXML(). Now this dataset has various datatable,...
11
by: Richard Maher | last post by:
Hi, I have read many of the copius entries on the subject of IE performance (or the lack thereof) when populating Select Lists. I don't mind the insert performance so much, (I get 100x120byte...
2
by: mschmidt18 | last post by:
Hi, I am writing my first web app in VB.Net, after being very familiar with C#.Net. I am trying to store the results of the SqlDataSource.Select() method. In C#, the select method returns a...
3
by: Jeff | last post by:
hey ..NET 2.0 I have a datatable which consist of 3 columns (int, date, value). This DataTable have 3 rows, the values of the "date" ("date" column is of datetime datatype) column is:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.