BindContext and EndCurrentEdit() problem

T

tinzo

SQL:

select * from A LEFT JOIN B using (seq)
(forget about the "using", it's Oracle 10g)

DataSet (ds) filled by DataAdapter (adp) with
MissingSchemaAction.AddWithKey (it seems AddWithKey doesn't work with
joins).

DataAdapter.InsertCommand is defined by hand.

I issue a BindContext.AddNew(), then I do some editing in the form
controls and finally I do a BindContext.EndCurrentEdit() and a
DataAdapter.Update(ds, "A").

The problem is that right after EndCurrentEdit() and just before
Update() the controls on the form go blank, they're cleared. But if I
edit using "BindContext.Current[colName] = value" they're kept.

It sounds like no changes are logged when editing in the form controls.

Why is that happening?
It it's because of the JOIN, how to make it work ?

Andre.
 
C

Cor Ligthert

Tinzo,

I see a day long no answers on your question.

For me this is probably the problem, I don't understand it, I assume others
as wel not.
The problem is that right after EndCurrentEdit() and just before
Update() the controls on the form go blank, they're cleared. But if I
edit using "BindContext.Current[colName] = value" they're kept.

What happens in between of that (I mean in your code) or do you mean that
you hide all your controls?

Or in other words what is the importancy that you tell that it happens
before the Update.

Cor
 
C

Cor Ligthert

Before you say it.
For me this is probably the problem, I don't understand it, I assume
others as wel not.

For me is probably the problem, I don't understand it, I assume others as
wel not.
 
T

tinzo

Well, let me try again.
I fill a DataSet using a DataAdapter from a JOIN sql.
Then, I build the DataAdapter.InsertCommand by myself (because of the
JOIN in the sql, it won't build automatically).
I bind to some TextBoxes on the form.
I issue a BindContext[].AddNew().
I start editing those fields: Name, LastName, etc... (all string
fields).
When I call BindContext[].EndCurrentEdit(), to finish editing, the Text
property of the TextBoxes are cleared out, they disapear, go blank.
Then, the DataAdapter.Update() fails, of course.
I'd like to know why is this happening ?
 
C

Cor Ligthert

Tinzo,

In this scenario is what is showed in the textboxes the last row that has
been added using that bindingcontext. For a reason that "last" row is not
filled with text, are you sure you fill that last row and not another or
something like that?

Cor
 

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