AcceptChanges doesn't do anything !

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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?
 
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?
 
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?
 
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
 
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?
 
Back
Top