AcceptChanges doesn't do anything !

G

Guest

DataTable orders;
getSqlData(orders);
for (i = 0; i < orders.Rows.Count; i++)
{
orders.Rows[8] = 800;
}
orders.AcceptChanges();
ExcelView.DataSource = orders;
ExcelView.DataBind();
How can I get a gridview control to accept my changes?
 
W

W.G. Ryan - MVP

Arne - are you asking how do you get it to update the database or how to
make the changes show? If the latter, where is this being called, what
event?
 
G

Guest

I want to edit one column before presenting the data.
orders.Rows[8] = 800
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)


Miha Markic said:
Arne, what changes are you talking about?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Arne Garvander said:
DataTable orders;
getSqlData(orders);
for (i = 0; i < orders.Rows.Count; i++)
{
orders.Rows[8] = 800;
}
orders.AcceptChanges();
ExcelView.DataSource = orders;
ExcelView.DataBind();
How can I get a gridview control to accept my changes?
 
G

Guest

No I don't want to send anything to database. I am writing a report. One of
the columns needs to be compute during the creation of the report.
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)


W.G. Ryan - MVP said:
Arne - are you asking how do you get it to update the database or how to
make the changes show? If the latter, where is this being called, what
event?
Arne Garvander said:
DataTable orders;
getSqlData(orders);
for (i = 0; i < orders.Rows.Count; i++)
{
orders.Rows[8] = 800;
}
orders.AcceptChanges();
ExcelView.DataSource = orders;
ExcelView.DataBind();
How can I get a gridview control to accept my changes?
 
C

Cor Ligthert [MVP]

Arne,

I would not say anything, what happens is that it tells to all those rows
that the rowstate is set from modified to notchanged and that the
originalrows are deleted. But that is only affecting the rowstate. It means
that it will not be updated anymore to a database when using a
data/tableadatper.

I hope this gives an idea

Cor
 
W

W.G. Ryan - MVP

That's what I was asking, which one. So what event is this being called
from?
Arne Garvander said:
No I don't want to send anything to database. I am writing a report. One
of
the columns needs to be compute during the creation of the report.
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)


W.G. Ryan - MVP said:
Arne - are you asking how do you get it to update the database or how to
make the changes show? If the latter, where is this being called, what
event?
message
DataTable orders;
getSqlData(orders);
for (i = 0; i < orders.Rows.Count; i++)
{
orders.Rows[8] = 800;
}
orders.AcceptChanges();
ExcelView.DataSource = orders;
ExcelView.DataBind();
How can I get a gridview control to accept my changes?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top