Click here to Skip to main content
16,005,826 members
Home / Discussions / C#
   

C#

 
AnswerRe: Why exception is not catched ? Pin
Judah Gabriel Himango24-Dec-06 8:40
sponsorJudah Gabriel Himango24-Dec-06 8:40 
AnswerRe: Why exception is not catched ? Pin
Colin Angus Mackay24-Dec-06 8:43
Colin Angus Mackay24-Dec-06 8:43 
QuestionPicture process in C# Pin
abalfazl24-Dec-06 4:06
abalfazl24-Dec-06 4:06 
AnswerRe: Picture process in C# Pin
Colin Angus Mackay24-Dec-06 8:45
Colin Angus Mackay24-Dec-06 8:45 
QuestionVideo and .Net Framework Pin
Silver Illussion24-Dec-06 3:25
Silver Illussion24-Dec-06 3:25 
AnswerRe: Video and .Net Framework Pin
Judah Gabriel Himango24-Dec-06 8:45
sponsorJudah Gabriel Himango24-Dec-06 8:45 
GeneralRe: Video and .Net Framework Pin
Silver Illussion26-Jan-07 20:07
Silver Illussion26-Jan-07 20:07 
QuestionRemove rows in datagridview and save the dataset xml file Pin
Yustme23-Dec-06 23:43
Yustme23-Dec-06 23:43 
Hi,

I made an even handler for removed rows in the datagridview.

The datagridview gets its data from an xml file. When a row is removed in the datagridview, the row should be removed in the dataset as well.

This is my event handler in constructor:

this.grdTest.RowsRemoved += new DataGridViewRowsRemovedEventHandler(grdTest_RowsRemoved);

This is the code in that event handler:

void grdTest_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml("Test.xml");

foreach (DataRow dr in ds.Tables[0].Rows)
{
string remove = dr["Row"].ToString();
DataRow[] temprows = ds.Tables[0].Select("Row = " + remove);

if (temprows[0].RowState == DataRowState.Deleted)
{
ds.Tables[0].Rows.Remove(temprows[0]);
}

//if (dr.RowState == DataRowState.Deleted)
//{
// ds.Tables[0].Rows.Remove(dr);
//}
}
ds.Dispose();
}


This is how the xml file looks like:

<?xml version="1.0" encoding="UTF-8" ?>
- <Root>
- <Column>
<Row>test1</Row>
</Column>
- <Column>
<Row>test2</Row>
</Column>
- <Column>
<Row>test3</Row>
</Column>
- <Column>
<Row>test4</Row>
</Column>
</Root>

When i try to start the proram, it gives me this error:

Cannot fine column [test1].

In this line:

DataRow[] temprows = ds.Tables[0].Select("Row = " + remove);

I've tried almost everything to fix this.

I'm running out of ideas...

Can somebody help me with this problem?

Thanks in advance!

AnswerRe: Remove rows in datagridview and save the dataset xml file Pin
Judah Gabriel Himango24-Dec-06 9:02
sponsorJudah Gabriel Himango24-Dec-06 9:02 
GeneralRe: Remove rows in datagridview and save the dataset xml file Pin
Yustme24-Dec-06 9:14
Yustme24-Dec-06 9:14 
QuestionHow to fill null value for a column while selecting in oracle Pin
NK723-Dec-06 22:17
NK723-Dec-06 22:17 
AnswerRe: How to fill null value for a column while selecting in oracle Pin
Judah Gabriel Himango24-Dec-06 8:49
sponsorJudah Gabriel Himango24-Dec-06 8:49 
QuestionHow to Replicate/sync local database with Network database using c# application Pin
80Eddy23-Dec-06 19:16
80Eddy23-Dec-06 19:16 
AnswerRe: How to Replicate/sync local database with Network database using c# application Pin
Judah Gabriel Himango24-Dec-06 8:54
sponsorJudah Gabriel Himango24-Dec-06 8:54 
Questiontimer and thread in windows service Pin
justintimberlake23-Dec-06 18:32
justintimberlake23-Dec-06 18:32 
AnswerRe: timer and thread in windows service Pin
Judah Gabriel Himango24-Dec-06 8:56
sponsorJudah Gabriel Himango24-Dec-06 8:56 
QuestionJPEG Pin
MozhdehQeraati23-Dec-06 18:30
MozhdehQeraati23-Dec-06 18:30 
AnswerRe: JPEG Pin
Paul Conrad23-Dec-06 18:54
professionalPaul Conrad23-Dec-06 18:54 
GeneralRe: JPEG Pin
MozhdehQeraati25-Dec-06 20:41
MozhdehQeraati25-Dec-06 20:41 
AnswerRe: JPEG Pin
Luc Pattyn23-Dec-06 19:01
sitebuilderLuc Pattyn23-Dec-06 19:01 
GeneralRe: JPEG Pin
MozhdehQeraati25-Dec-06 22:58
MozhdehQeraati25-Dec-06 22:58 
AnswerRe: JPEG Pin
Christian Graus23-Dec-06 19:02
protectorChristian Graus23-Dec-06 19:02 
GeneralRe: JPEG Pin
MozhdehQeraati25-Dec-06 22:59
MozhdehQeraati25-Dec-06 22:59 
QuestionNHibernate query problem. Pls help me! Pin
senorAli3323-Dec-06 17:47
senorAli3323-Dec-06 17:47 
AnswerRe: NHibernate query problem. Pls help me! Pin
Judah Gabriel Himango24-Dec-06 8:58
sponsorJudah Gabriel Himango24-Dec-06 8:58 

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.