Naming Convention:
My response to you is: Ok.
I'm not sure what else I can say / what other info to provide. You're asking why the naming convention is different from what you feel it should be. I didn't explicitly name it myself. it was generated. So... it was just a guess as to why the system would pick up the child table name first.
It doesnt; that's what I'm saying.. I cant work out why it would be named that way round.. If in doubt, I'd actually delete the relationship and recreate it, ensuring that the parent and child are correct
I'm a newbie, not an idiot - So I do understand that the location of the tables on the designer doesn't define the relationship. I was thinking it might affect which table was picked up first for the NAME of the relationship - which was your question, was it not?
OK, maybe youre not used to asking questions in forums, but I really have only a very limited awareness of what is going on in your system, and the way you phrase things, and the words you choose make it very hard. In computer terms the best style of posting is to be very literal, not use colloqialisms, post all error messages in full and the lines on which they occur and to name everything correctly. I give a huge amount of my free time to people of this forum for free, so please dont sit there and criticize something you dont like about my tone, when I'm drilling you for information you havent provided and struggling to get you to explain your problem clearly
As stated before, and as confirmed by your snapshot, there is nothing wrong with the way the relationship itself has been defined.
I definitely recommend deleting it and starting another. CLick the column in the parent, point to the grey square to the left of the name, click, drag and drop into the grey square in the child that you wish to link. Set it to being an FK, if that's your requirement.. Quick check of all columns and that should be it
I think it's obvious that the system is trying to do SOMETHING that clears the tables in an order that it doesn't like...
It's not artificially intelligent. The presence or absence of a datarelation will not make things clear and fill in the right logical order, you have to do this as the programmer. If youre calling Fill, you hav eto know that by default it will first invoke a clear. If you try and fill the parent it will fail because child rows exist and the TA is trying to do a clear before a fill
Learning to work the debugger in vs2005 would save a lot of these troubles
i can't fill my parent table first via the parent "TABLE ADAPTER" first before calling the fill method on the child TABLE ADAPTER.
I think I said 3 or 4 posts ago that TA will clear first, before fill (otherwise you'd either get constraint errors or just keep appending the same records). You understand that a clear can create orphans, and that's not allowed, but you didnt seem to make this link between "fill clears first" and creating orphans yet. Here is some code, see the comments for why i do it:
childDT.Clear() 'kill children before they are orphaned
parentTA.Fill(parentDT) 'clear and refill parents
childTA.ClearBeforeFill = False 'dont clear children first, see below
ForEach parentRo as ParentRow in parentDT 'for every parent
childTA.FillByParentID(childDT, parentRo.ID) 'fill the children of that parent, note if we cleared first, we'd only have last parent's children!, see above
Next parentRo
My apologies if I'm not using the right lingo - just figured that by this post, you'd understand what it is that I'm trying to accomplish via the error messages and code snippets.
I probably could, but I really dont have the time. I'm like a computer myself; feed me literal info that my brain can process and i'll get the answer very quickly.. Have me start inventing and guessing at what you mean and I cant be bothered to answer beyond a few sentences that are designed to get the info i want because so many times in the past (and ive racked up tens of thousands of posts on various places) someone's asked a question, its been ambiguous or hard to understand, I've put 20 minutes into writie a long and explanatory post of every option i can think of.. and its turne dout to be "none of the above" - i lose 20 minutes. As such, I dont do it any more. If a post is crap and hard to understand, I simply ask for clarification
to clarify my question about why the attempt to clear the table is taking place
Becuase most the time when you fill you dont wanna fill onto the end of your existing data?
As such, rahter than have you call CLear() yourself every time, MS just made the TA do it and switched it via a boolean for the few times you wanna append, like in my code example where I have maybe 10 out of 10,000 parents loaded, and i just wanna fill the children of those 10, not the children of all 10,000 (which might be many more than 10,000)
Why do i have to set something to NULL first (let me guess, this is a bad example...?) before I set it to object X?
You mean:
Dim s as Stirng = Nothing
s = "Something"
?
You dont
Dim s as String = "Something"
Will work just fine
For some of us learners, it's hard to articulate questions clearly when you have pressure to get something out the door and something's not working quite right.
I appreciate that, i've been in that situation, i've delayed projects while my knowledge updated and it's a hard place to be.. I did, however, when asking for help in forums and was asked to do things, do them as asked..
You might just have to put up with the sarcasm though; it's part of my sense of humour