none
Table adapters

    Question

  • I am building some applications that work around an ACCESS database.  I have noticed that often, when building forms that when I put in controls that that have a data/binding source that a fill query is placed into the load event. e.g.

    Me.LkpMBDeptTableAdapter.Fill(Me._MasterBase2_0ValMasterDataSet.lkpMBDept)

    I can understand that if one has data that needs to be displayed in databound controls when the form is loaded that you would need to have a query in place for that data to show.  However, most of the time that I load a form there is only a specific set of data that I want shown and I will use a query that is specific for what I want displayed in the form in the load event.

    What I would like to know is what value is there in these queries being in the load event if they are not actually used for anything in the load event?  Do these do anything to slow down the loading and execution of the form events/routines?


    gwboolean

    Friday, April 28, 2017 5:02 PM

Answers

  • Right Click in solution explorer on the dataset.

    Now do configure 

    In that you use as select something like "Select FirstName, LastName from Names Where City = ?"

    Then follow it to the end. Then something is created which has the name you choose and then you can do

    LkpMBDeptTableAdapteer.YourNewProcedureName as a Fill or as a GetData 


    Success
    Cor



    • Edited by Cor LigthertMVP Friday, April 28, 2017 6:12 PM
    • Marked as answer by gwboolean Saturday, April 29, 2017 6:46 PM
    Friday, April 28, 2017 6:10 PM

All replies

  • Right Click in solution explorer on the dataset.

    Now do configure 

    In that you use as select something like "Select FirstName, LastName from Names Where City = ?"

    Then follow it to the end. Then something is created which has the name you choose and then you can do

    LkpMBDeptTableAdapteer.YourNewProcedureName as a Fill or as a GetData 


    Success
    Cor



    • Edited by Cor LigthertMVP Friday, April 28, 2017 6:12 PM
    • Marked as answer by gwboolean Saturday, April 29, 2017 6:46 PM
    Friday, April 28, 2017 6:10 PM
  • Sorry I didn't notice this before Cor, I have spent two days of pain and suffering to finally figure out how all of this works.  First off, it is not a visual basic thing, it is a database thing.  What I found was that there is a reason why all of those query calls are automatically put into a load event.

    In my case this form is loaded with controls that are data bound to elements from 6 different tables.  Additionally, there are two other tables that are used a little bit differently in this form.  So to make my long sad story short, every single table that is used with a control must be addressed in the form of a query call in the load event.  Now in some cases I have specific tasks that require a specific type of query call and I do that as needed.  But for those controls (especially comboboxes, which are nasty little farts that have caused me much misery) that have no specific activity going on in the form code there has to be a query call (just a fill) at the beginning of the load event.

    Unrelated, I have also found that when any of your query calls use something other than just a fill query (has parameters for filtering) it is a good idea to put those calls into a Try/Catch because if the resulting records filtered is Null then a code break occurs.  Why is learning so damned painful?


    gwboolean

    • Marked as answer by gwboolean Saturday, April 29, 2017 4:55 PM
    • Unmarked as answer by gwboolean Saturday, April 29, 2017 6:46 PM
    Saturday, April 29, 2017 4:54 PM
  • Well Cor, to be honest what you were suggesting really did not apply to the situation.  However, if it is that important to you.....

    gwboolean

    Saturday, April 29, 2017 6:45 PM
  • What the hell are you talking about and who cares whether you use your real name or whatever the hell else you want to use?  This is a goddamned forum for people to use to discuss issues with programming and help each other, not some dipshit board for people to play games and bullshit around with each other.

    I come here with questions that I would like assistance/advice from those who I assume to have greater knowledge and experience than I do with this.  I am here for help, not to play games and listen to some deranged and condescending shit from someone who appears to have some kind of agenda.

    If you are not interested in either assisting someone with programming issues or being assisted by someone who might have information or experience to assist you then why do you bother wasting your time and the time of others here?

    I don't care what your real name is or whether you are a chicken or not or whether you are a Nazi.  As for using your name, I use the name that I see at the bottom of a message, like any normal person would do and I have no idea or care whether that is a real name or an alias.

    As for my original question, you offered some information that, while interesting, provided nothing that was even close to the solution to the question.  I did that myself over a period of a couple of days.  However, for some reason, you seem to be caught up in whatever this crap of points or whatever it is that apparently people can run up on this forum.  And since that is apparently important to you I awarded you the answer mark, even though you provided nothing that was an answer to the original question.  

    If you have nothing to offer me in the form of help to my questions on this forum then I suggest you ignore anything I post here and I will just deal with those who are interested in discussion of the subject material and have something to offer other than some kind of ridiculous drivel about real names and aliases.

    Christ on a Crutch, I just can't believe this crap!

     

    gwboolean

    Sunday, April 30, 2017 8:58 AM
  • What the hell are you talking about and who cares whether you use your real name or whatever the hell else you want to use?  This is a goddamned forum for people to use to discuss issues with programming and help each other, not some dipshit board for people to play games and bullshit around with each other.

    I come here with questions that I would like assistance/advice from those who I assume to have greater knowledge and experience than I do with this.  I am here for help, not to play games and listen to some deranged and condescending shit from someone who appears to have some kind of agenda.

    If you are not interested in either assisting someone with programming issues or being assisted by someone who might have information or experience to assist you then why do you bother wasting your time and the time of others here?

    I don't care what your real name is or whether you are a chicken or not or whether you are a Nazi.  As for using your name, I use the name that I see at the bottom of a message, like any normal person would do and I have no idea or care whether that is a real name or an alias.

    As for my original question, you offered some information that, while interesting, provided nothing that was even close to the solution to the question.  I did that myself over a period of a couple of days.  However, for some reason, you seem to be caught up in whatever this crap of points or whatever it is that apparently people can run up on this forum.  And since that is apparently important to you I awarded you the answer mark, even though you provided nothing that was an answer to the original question.  

    If you have nothing to offer me in the form of help to my questions on this forum then I suggest you ignore anything I post here and I will just deal with those who are interested in discussion of the subject material and have something to offer other than some kind of ridiculous drivel about real names and aliases.

    Christ on a Crutch, I just can't believe this crap!

     

    gwboolean

    GW,

    I agree completely.

    Cor has donned himself the 'prince of the forum' but that doesn't make it so.

    He actually thinks that we think he's knowledgeable about programming!

    He's a joke - ignore him. He's like the guy who thinks he's the leader of the parade but in reality he saw the parade and jumped in front.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Sunday, April 30, 2017 12:43 PM

  • I agree completely.

    Cor has donned himself the 'prince of the forum' but that doesn't make it so.

    He actually thinks that we think he's knowledgeable about programming!

    He's a joke - ignore him. He's like the guy who thinks he's the leader of the parade but in reality he saw the parade and jumped in front.



    Glad to know Frank.

    I don't even report this as abuse. It is to vulgar therefor. 

    Be aware the word is not donned, but crowned in normal English. 



    Success
    Cor


    You're a gadfly Cor ... now go away.

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Sunday, April 30, 2017 4:50 PM
  • GW,

    Have you noticed something odd here?

    Cor replied twice - to me, taking a jab each time - then removed his replies. I think that's very telling about his character don't you?

    But then again that's pretty typical of Cor. For example, in this thread, the only reason that Cor had to jump in there was to:

    a) Bolster his own ego ("...would have done it the same way as Acamar"), and

    b) Take a personal jab at me ("I've seen how much work you made of this question.")

    Maybe Cor will realize that I don't mark personal attacks on me as abusive because I don't want a moderator to do my work.

    Instead, when he jabs - I'll jab back.

    *****

    Quid pro quo Cor Lightert.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Monday, May 1, 2017 4:55 PM
  • You wrote:
    1. Taking a jab each time (and removed it)
    2. this thread (the link)
    3. bolster his own ego
    4. would have done it the same way as Acamar
    5. Cor personal attacks on Frank

    ad 1, you have copied all I wrote after you came in. all others where already deleted, I see no jabs in it.
    ad 2, maybe it is your culture, but I don't see any word which can be marked as abuse
    ad 3, wrong, I see not not any reason to do that.
    ad 4, to avoid sending again the same text as Acamar
    ad 5, Show the personal attacks and not in a thread in which you have not any real contribution.

    I deleted everything from me in this thread because I found it to low to be involved in. But a moderator can see that there is not any "jab" in it.

    I will remove this one too by the way at least tomorrow. It is on a level I don't want to be.  


    Success
    Cor


    Keep on Cor, but this time I've had enough. Even if this is locked and this thread it tossed away, you'll get the e-mail.

    If YOU fuck with ME again - I will fuck with YOU in a big way.

    That's the bottom line.

    *****

    I'm sure that you take no responsibility in whatever happened to John, right? You should - you encouraged him each and every time. EACH TIME you'd give him five point "pats on the back" and propose him as answerer.

    YOU did that Cor, not me.

    He took it over the top but how dare you stand in the shadow of innocence.

    You're a grade-A first class asshole.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Monday, May 1, 2017 6:24 PM