M
Markus Freitag
Guest
Hello,
I traced it to see what happens.
Additional Question
var qry3_3 = (from a in panelData.AsEnumerable()
where a.Finished == "0"
join b in result.AsEnumerable() on a.Id equals b.Id
where b.No == 3
//select new not new I want to use the same recordset, same row
select b).FirstOrDefault();
qry3_3.Ref1 = "TESSSSSSSSSSST";
qry3_3.Ref = "TEssssSSSSSSSSSSST";
ds.AcceptChanges();
Unfortunately, the changes are not accepted, for whatever reason.
How can I make changes and save again? What do I have to do?
I saw you do it with new. I do not need that. There is no other way?
I need to tell changes, is it enough about dataset or any table?
ds.Tables["PANEL"].AcceptChanges();
ds.Tables["INDEX"].AcceptChanges();
ds.AcceptChanges();
Why?
I think, we use here new Operator.
var panelData1 = ds.Tables["PANEL"]
.AsEnumerable()
.Select(row => new PanelData()
{
Id = row.Field<int>("PANEL_id") + 1, // Primary Key by myself
Finished = row.Field<string>("finished")
});
This works not, because the PanelData is unknown.
var panelData = ds.Tables["PANEL"].AsEnumerable(); //.ToList();
//How I can solve it?
// Load -- Edit -- and save it
// Save dataset
ds.WriteXml("..\\..\\T1_new_after_Modification_Dataset.xml");
With best regards Markus
My Tracing.
WORKS_ORDER
PRODUCT
PANELS
PANEL
INDEX
#########################
QUANTITY= 3, WORKS_ORDER_Id= 0, id= 060418001, type= OWN,
#########################
PRODUCT_Id= 0, model= 203 test5-01 V05, WORKS_ORDER_Id= 0,
#########################
PANELS_Id= 0, PRODUCT_Id= 0,
#########################
PANEL_Id= 0, no= 1, state= 0, finished= 1, PANELS_Id= 0,
PANEL_Id= 1, no= 2, state= 0, finished= 1, PANELS_Id= 0,
PANEL_Id= 2, no= 3, state= 0, finished= 0, PANELS_Id= 0,
PANEL_Id= 3, no= 4, state= 0, finished= 0, PANELS_Id= 0,
PANEL_Id= 4, no= 5, state= 0, finished= 0, PANELS_Id= 0,
#########################
no= 1, state= 0, ref1= 0001, PANEL_Id= 0
no= 2, state= 0, ref1= 0001,
no= 3, state= 0, ref1= 0001,
no= 4, state= 0, ref1= 0001,
no= 5, state= 0, ref1= 0001,
no= 6, state= 0, ref1= 0001,
no= 7, state= 0, ref1= 0001,
no= 8, state= 0, ref1= 0001,
no= 9, state= 0, ref1= 0001,
no= 10, state= 0, ref1= 0001,
no= 1, state= 0, ref1= 0002, PANEL_Id= 1
no= 2, state= 0, ref1= 0002,
no= 3, state= 0, ref1= 0002,
no= 4, state= 0, ref1= 0002,
no= 5, state= 0, ref1= 0002,
no= 6, state= 0, ref1= 0002,
no= 7, state= 0, ref1= 0002,
no= 8, state= 0, ref1= 0002,
no= 9, state= 0, ref1= 0002,
no= 10, state= 0, ref1= 0002,
no= 1, state= 0, ref1= 0003, PANEL_Id= 2
no= 2, state= 0, ref1= 0003,
no= 3, state= 0, ref1= 0003,
no= 4, state= 0, ref1= 0003,
no= 5, state= 0, ref1= 0003,
no= 6, state= 0, ref1= 0003,
no= 7, state= 0, ref1= 0003,
no= 8, state= 0, ref1= 0003,
no= 9, state= 0, ref1= 0003,
no= 10, state= 0, ref1= 0003,
no= 1, state= 0, ref1= 0004, PANEL_Id= 3
no= 2, state= 0, ref1= 0004,
no= 1, state= 0, ref1= 0005, PANEL_Id= 4
no= 2, state= 0, ref1= 0005,
Continue reading...
I traced it to see what happens.
Additional Question
var qry3_3 = (from a in panelData.AsEnumerable()
where a.Finished == "0"
join b in result.AsEnumerable() on a.Id equals b.Id
where b.No == 3
//select new not new I want to use the same recordset, same row
select b).FirstOrDefault();
qry3_3.Ref1 = "TESSSSSSSSSSST";
qry3_3.Ref = "TEssssSSSSSSSSSSST";
ds.AcceptChanges();
Unfortunately, the changes are not accepted, for whatever reason.
How can I make changes and save again? What do I have to do?
I saw you do it with new. I do not need that. There is no other way?
I need to tell changes, is it enough about dataset or any table?
ds.Tables["PANEL"].AcceptChanges();
ds.Tables["INDEX"].AcceptChanges();
ds.AcceptChanges();
Why?
I think, we use here new Operator.
var panelData1 = ds.Tables["PANEL"]
.AsEnumerable()
.Select(row => new PanelData()
{
Id = row.Field<int>("PANEL_id") + 1, // Primary Key by myself
Finished = row.Field<string>("finished")
});
This works not, because the PanelData is unknown.
var panelData = ds.Tables["PANEL"].AsEnumerable(); //.ToList();
//How I can solve it?
// Load -- Edit -- and save it
// Save dataset
ds.WriteXml("..\\..\\T1_new_after_Modification_Dataset.xml");
With best regards Markus
My Tracing.
WORKS_ORDER
PRODUCT
PANELS
PANEL
INDEX
#########################
QUANTITY= 3, WORKS_ORDER_Id= 0, id= 060418001, type= OWN,
#########################
PRODUCT_Id= 0, model= 203 test5-01 V05, WORKS_ORDER_Id= 0,
#########################
PANELS_Id= 0, PRODUCT_Id= 0,
#########################
PANEL_Id= 0, no= 1, state= 0, finished= 1, PANELS_Id= 0,
PANEL_Id= 1, no= 2, state= 0, finished= 1, PANELS_Id= 0,
PANEL_Id= 2, no= 3, state= 0, finished= 0, PANELS_Id= 0,
PANEL_Id= 3, no= 4, state= 0, finished= 0, PANELS_Id= 0,
PANEL_Id= 4, no= 5, state= 0, finished= 0, PANELS_Id= 0,
#########################
no= 1, state= 0, ref1= 0001, PANEL_Id= 0
no= 2, state= 0, ref1= 0001,
no= 3, state= 0, ref1= 0001,
no= 4, state= 0, ref1= 0001,
no= 5, state= 0, ref1= 0001,
no= 6, state= 0, ref1= 0001,
no= 7, state= 0, ref1= 0001,
no= 8, state= 0, ref1= 0001,
no= 9, state= 0, ref1= 0001,
no= 10, state= 0, ref1= 0001,
no= 1, state= 0, ref1= 0002, PANEL_Id= 1
no= 2, state= 0, ref1= 0002,
no= 3, state= 0, ref1= 0002,
no= 4, state= 0, ref1= 0002,
no= 5, state= 0, ref1= 0002,
no= 6, state= 0, ref1= 0002,
no= 7, state= 0, ref1= 0002,
no= 8, state= 0, ref1= 0002,
no= 9, state= 0, ref1= 0002,
no= 10, state= 0, ref1= 0002,
no= 1, state= 0, ref1= 0003, PANEL_Id= 2
no= 2, state= 0, ref1= 0003,
no= 3, state= 0, ref1= 0003,
no= 4, state= 0, ref1= 0003,
no= 5, state= 0, ref1= 0003,
no= 6, state= 0, ref1= 0003,
no= 7, state= 0, ref1= 0003,
no= 8, state= 0, ref1= 0003,
no= 9, state= 0, ref1= 0003,
no= 10, state= 0, ref1= 0003,
no= 1, state= 0, ref1= 0004, PANEL_Id= 3
no= 2, state= 0, ref1= 0004,
no= 1, state= 0, ref1= 0005, PANEL_Id= 4
no= 2, state= 0, ref1= 0005,
Continue reading...