PC Review


Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average.

BindContext and EndCurrentEdit() problem

 
 
tinzo
Guest
Posts: n/a
 
      30th Jun 2005
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.

 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      30th Jun 2005
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



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      30th Jun 2005
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.


 
Reply With Quote
 
tinzo
Guest
Posts: n/a
 
      1st Jul 2005
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 ?

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      1st Jul 2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid EndCurrentEdit Problem persists... Jan Nielsen Microsoft VB .NET 4 14th Dec 2004 08:53 AM
Datagrid EndCurrentEdit problem... Jan Nielsen Microsoft ADO .NET 2 8th Dec 2004 07:36 PM
Datagrid EndCurrentEdit problem... Jan Nielsen Microsoft VB .NET 2 8th Dec 2004 07:36 PM
Problem with Form.BindContext().Position Mauricio Microsoft Dot NET Framework Forms 4 14th Nov 2003 06:25 PM
problem with BindingContext[].EndCurrentEdit() Peter Microsoft C# .NET 0 16th Sep 2003 03:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 AM.