473,397 Members | 1,972 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,397 software developers and data experts.

How to search by date in an xml file and display it on a datagrid in vb.net.

I have an xml file:

<?xml version="1.0"?>
<ProductList>
<Products>
<SKU>1</SKU>
<Price>100.00</Price>
<Description>Widget #1</Description>
<pubDate>8/6/2004</pubDate>
</Products>
<Products>
<SKU>2</SKU>
<Price>10.00</Price>
<Description>Widget #2</Description>
<pubDate>8/6/2004</pubDate>
</Products>
<Products>
<SKU>3</SKU>
<Price>30.00</Price>
<Description>Widget #3</Description>
<pubDate>8/5/2004</pubDate>
</Products>
</ProductList>

Assume today date is 8/6/2004.

I have tried RowFilter = "pubDate = ‘"+Date.Today+"'"
and the Find method in DataView and then display it in on a datagrid
but to no avail why???
Nov 18 '05 #1
1 1202
Date.Today is going to return "8/6/2004 12:00:00 AM".
Date.Today.ToShortDateString should return "8/6/2004"; try that.

---
Greg Hurlman
ghurlman*AT*squaretwo*DOT*net
http://blogs.squaretwo.net

"Avatar Viper" wrote:
I have an xml file:

<?xml version="1.0"?>
<ProductList>
<Products>
<SKU>1</SKU>
<Price>100.00</Price>
<Description>Widget #1</Description>
<pubDate>8/6/2004</pubDate>
</Products>
<Products>
<SKU>2</SKU>
<Price>10.00</Price>
<Description>Widget #2</Description>
<pubDate>8/6/2004</pubDate>
</Products>
<Products>
<SKU>3</SKU>
<Price>30.00</Price>
<Description>Widget #3</Description>
<pubDate>8/5/2004</pubDate>
</Products>
</ProductList>

Assume today date is 8/6/2004.

I have tried RowFilter = "pubDate = ‘"+Date.Today+"'"
and the Find method in DataView and then display it in on a datagrid
but to no avail why???

Nov 18 '05 #2

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

Similar topics

5
by: Greg | last post by:
I have a page that searches a database by a repairman's name and by a date range. It pulls info by the repairman's name but pulls all info in the database regardless of the date. Below is the code...
0
by: Chumley the Walrus | last post by:
Inside a datagrid that has editcommandcolumns and such, I'm able to format a date variable with DataFormatString ="{0:d}" to display a properly formatted date of 7/14/2004 instead of 7/14/2004...
0
by: Steve | last post by:
C# windows I have a simple(ish) enquiry screen. on this I have a search button. I want the search window to popup as a seperate non-modal window, allow the user to search and display the...
2
by: David Slinn | last post by:
I have created a simple XML document, generated a schema from it (which Visual Studio makes everything a string element). I then went through and changed all fields that are dates to the Date data...
2
by: Sriram | last post by:
Hi, i am developing a search page, basically using datagrid. i have given a column as hyperlink so that when the user clicks on it, it gives the details of the selected item in a seperate page....
6
by: yoshitha | last post by:
hi db : sql server 2000 lan : C#.net(ASp.Net) in my database table there are 2 fileds of data type datatime. in field 1 i'm storing date in field 2 i'm storing time.
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
by: Sharmila06 | last post by:
hi Am a dotnet student working in a C# project. i want to search n display the result in datagrid , i want to search with the starting character once i type the first char in textbox i want the...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.