New Posts New Posts RSS Feed: Parent child Insertion problem (0racle)
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Parent child Insertion problem (0racle)

 Post Reply Post Reply Page  12>
Author
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Topic: Parent child Insertion problem (0racle)
    Posted: 03-Sep-2010 at 1:42pm
Yeah very much working for me

Thanks you solved my big problem

:)
Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 03-Sep-2010 at 1:26pm
Hey Bala, look this link:

http://www.ideablade.com/forum/forum_posts.asp?TID=2121&PID=8353#8353

this will solve the problem.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 03-Sep-2010 at 5:19am
Hi Denisk
 
Did you check solution with Oracle. This is I really need to work with oracle.
Please check and let me know..
 
Thanks for helping...
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 11:52am
Hi Bala;

It does sound curious as to why it works in Microsoft SQL server but not in Oracle. Let me test it out with Oracle and let you know.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 6:51am
Hi Denisk..

Finally I made database in SQL server and got sucess.

But still I need to solve problem with Oracle.I am using oracle database for my project.

Thanks for you vital help. Can you try this stuff in oracle If you have.


Thanks a Lot




Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 30-Aug-2010 at 4:25pm
Bala;

Please try the link again and use this statement instead.

if (!args.HasError)
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 30-Aug-2010 at 12:52pm
Hi
I copy your code but few keywords does not exits.
   if (args.CompletedSuccessfully) {
i do not have completedSucessfully..

 Which version are you using?
And your zip file also not opening..

Could you post again?

Thanks for replying..



Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 30-Aug-2010 at 12:14pm
Bala;

I duplicated your database using the screenshots that you had sent me and I wrote the exact same logic (see below). I did not get any error. I've attached my edmx file. Maybe you can see what my edmx file is like and compare it to yours. Hopefully it will help.

     var mgr = new ModelTestEntityManager();

      ITEMVENDA novoItem = new ITEMVENDA();
      novoItem.NOME = "some NOME text";
      novoItem.VALORUNIT = 10;

      VENDA novo = new VENDA();
      novo.TIPOPAGAMENTO = "some TIPO text";
      novo.VALORTOTAL = 10;
      novo.ITEMVENDAs.Add(novoItem);

      mgr.AddEntity(novo);
      mgr.SaveChangesAsync(args => {
        if (args.CompletedSuccessfully) {
          Output = "Completed successfully";
        } else {
          Output = "Save operation has the following errors: " + args.Error.Message;
        }
      });

Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2010 at 1:59pm
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2010 at 1:58pm
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2010 at 1:50pm
hey i I uploaded Images..
Could you see and tell me..

Where is problem..


Have a nice weekend..

Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2010 at 3:45pm
Bala;

I did a similar test insertion using the NorthwindIB database with the same parent child relation and it worked. So I'm guessing that it has something to do with your Entity Data Model. Could you upload your edmx file to the forum?

Thanks. 
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2010 at 2:02pm

Thanks for reply

Version is DevForce2010 v6.0.4.0

Yes, have realation one to many

VENDA 1 ============* ITEMVENDA


Thanks
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2010 at 1:38pm
Bala;

I'm going to need more information from you. Could you provide me with the following?

1. Your DevForce version

2. How your VENDA and ITEMVENDA tables are associated on your database.

Thanks,
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2010 at 4:15am
Thanks for answer..
I undestand the error and I know how it comes. But I like to know How the error generating from
my code. Because When I inserting manually it not showing any such error.

But when we try to insert from UI code this error population.

Is there any problem in my Code ?

If I am right it is not necerssary to bring ID of the parent to insert in Child. Navigation does automatically
it search ID for parent.

HOw can I acheive this?

If have with example that could be great help..

Thanks
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 25-Aug-2010 at 2:29pm
Bala;

Searching on Google gives me this

ORA-02291:

integrity constraint (string.string) violated - parent key not found
Cause:A foreign key value has no matching primary key value.
Action:Delete the foreign key or add a matching primary key.

You might want to take a look at your novoItem object and see if its foreign key has been linked to the primary key of novo. 
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down