Click here to Skip to main content
15,905,419 members
Home / Discussions / C#
   

C#

 
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 
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 
Hi Stephan,

Thanks again for your reply.

Im getting a really strange error about 'Table test does not belong to this DataSet.' from the console.

I googled up this error, but no information what tells me how to deal with this error.

This is the code i have produced so far (with help from you):

static void Main(string[] args)
{
try
{
DataSet xmlFile = new DataSet();
xmlFile.ReadXml("test.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 = DateTime.Now.Date.Subtract(new TimeSpan(30, 0, 0, 0));
int intOld = Int32.Parse(dateOld.ToString("yyyyMMdd"));

DateTime dtOld = DateTime.Now.Date;
while (dateOld.AddMonths(1).Date > DateTime.Now.Date)
{
dateOld = dateOld.Subtract(new TimeSpan(1, 0, 0, 0));

if( tempXmlFileRows.Length != 0)
xmlFile.Tables.Remove("test");
xmlFile.AcceptChanges();
}

}
xmlFile.WriteXml("test.xml");
}

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

Console.Read();
}

I cant use the DataRow[] array, coz if i do it says:

Cannot find table 0. In the console.

Thanks again!

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 
QuestionHow to install ? Pin
Mohammadreza Heidari8-Jun-06 7:37
Mohammadreza Heidari8-Jun-06 7:37 
AnswerRe: How to install ? Pin
Ed.Poore8-Jun-06 8:13
Ed.Poore8-Jun-06 8:13 
QuestionHow To Setup MSDE With My Setup Project Pin
AhmedElbaz8-Jun-06 6:57
AhmedElbaz8-Jun-06 6:57 
QuestionSkyWave Sample Application Pin
Majid Shahabfar8-Jun-06 6:02
Majid Shahabfar8-Jun-06 6:02 

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.