Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGridView grid lines??? Pin
Mairaaj Khan8-Jun-06 21:22
professionalMairaaj Khan8-Jun-06 21:22 
QuestionRegEx help Pin
econner8-Jun-06 9:02
econner8-Jun-06 9:02 
AnswerRe: RegEx help Pin
Dustin Metzgar8-Jun-06 9:06
Dustin Metzgar8-Jun-06 9:06 
GeneralRe: RegEx help Pin
econner8-Jun-06 9:11
econner8-Jun-06 9:11 
GeneralRe: RegEx help Pin
Le centriste8-Jun-06 9:24
Le centriste8-Jun-06 9:24 
GeneralRe: RegEx help Pin
Dustin Metzgar8-Jun-06 9:40
Dustin Metzgar8-Jun-06 9:40 
QuestionHow to get a list of active USB and Floppy-devices? Pin
Martin#8-Jun-06 8:58
Martin#8-Jun-06 8:58 
QuestionRemoving rows depending on date [modified] Pin
Yustme8-Jun-06 8:38
Yustme8-Jun-06 8:38 
Hi,

Im trying to remove a whole table from an xml file if the date is a month old or older.

This is the code i produced so far:

<code>using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Xml;
using System.IO;
using System.Xml.Xsl;
using System.Xml.Schema;
using System.IO.Compression;

namespace RemoveRows
{
class Program
{
static void Main(string[] args)
{
try
{

DataSet xmlFile = new DataSet();
xmlFile.ReadXml("xmlFile.xml");

foreach (DataRow dateRow in xmlFile.Tables[0].Rows)
{
string Date = dateRow["Date"].ToString();
DataRow[] tempXmlFileRows = xmlFile.Tables[0].Select("Date = " + Date);
DateTime dateNow = DateTime.Now;
DateTime dateOld =
string dateFormat = @"yyyy/MM/Dd";

}

}

catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

Console.Read();
}
}
}
</code>

And this is how the xmlFile looks like:

<root>
<test>
<Id> 1 </Id>
<Date> 20060604 </Date>
<Time> 1200 </Time>
</test>
</root>

The first 4 digits are presenting the year, the next 2 digits the month and the last 2 the day.

Can somebody help me with this please?

Thanks in advance!

-- modified at 14:38 Thursday 8th June, 2006
AnswerRe: Removing rows depending on date [modified] Pin
Stephan Samuel8-Jun-06 9:50
Stephan Samuel8-Jun-06 9:50 
GeneralRe: Removing rows depending on date [modified] Pin
Yustme8-Jun-06 10:15
Yustme8-Jun-06 10:15 
GeneralRe: Removing rows depending on date [modified] Pin
Stephan Samuel8-Jun-06 10:57
Stephan Samuel8-Jun-06 10:57 
GeneralRe: Removing rows depending on date [modified] Pin
Yustme8-Jun-06 12:24
Yustme8-Jun-06 12:24 
AnswerRe: Removing rows depending on date [modified] Pin
Stephan Samuel8-Jun-06 13:09
Stephan Samuel8-Jun-06 13:09 
GeneralRe: Removing rows depending on date [modified] Pin
Yustme8-Jun-06 22:04
Yustme8-Jun-06 22:04 
QuestionImages don't show in side toolbar Pin
Alaloom8-Jun-06 8:06
Alaloom8-Jun-06 8:06 
AnswerRe: Images don't show in side toolbar Pin
leppie8-Jun-06 20:48
leppie8-Jun-06 20:48 
QuestionPrinting a TabPage from a TabControl Pin
Mate68-Jun-06 8:04
Mate68-Jun-06 8:04 
AnswerRe: Printing a TabPage from a TabControl Pin
Thomas Stockwell8-Jun-06 14:13
professionalThomas Stockwell8-Jun-06 14:13 
QuestionIs it possible to force the KeyDown Event of a TextBox? Pin
Martin#8-Jun-06 7:50
Martin#8-Jun-06 7:50 
AnswerRe: Is it possible to force the KeyDown Event of a TextBox? Pin
Josh Smith8-Jun-06 8:07
Josh Smith8-Jun-06 8:07 
GeneralRe: Is it possible to force the KeyDown Event of a TextBox? Pin
Martin#8-Jun-06 8:43
Martin#8-Jun-06 8:43 
GeneralRe: Is it possible to force the KeyDown Event of a TextBox? Pin
Josh Smith8-Jun-06 14:23
Josh Smith8-Jun-06 14:23 
GeneralRe: Is it possible to force the KeyDown Event of a TextBox? Pin
Martin#8-Jun-06 20:00
Martin#8-Jun-06 20:00 
GeneralRe: Is it possible to force the KeyDown Event of a TextBox? [modified] Pin
Josh Smith9-Jun-06 1:57
Josh Smith9-Jun-06 1:57 
AnswerRe: Is it possible to force the KeyDown Event of a TextBox? Pin
Martin#9-Jun-06 9:42
Martin#9-Jun-06 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.