Fill 3 data sets at one time or copy one dataset to another

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chreo

    Fill 3 data sets at one time or copy one dataset to another

    Sorry for weird title and sorry for my English (I'm from Poland).

    This is the problem:
    I have form with many controls.
    There are three comboboxes - each should have table STREETS as DataSource.

    1) If I connect each combobox to one Dataset then if I choose street in one
    combobox it changes also in combobox 2 and 3.
    So one dataset to three comboboxes is bad idea, isn't it?
    But filling one dataset is fast.

    2) So I changed it. Now I have 3 datasets and 3 comboboxes - if I change
    street in one then it doesn't change anything in rest of boxes.
    Great! But when i open form then filling three dataset with the same values
    takes too much time.
    Because it is copying table STREETS from MSSQL Database to one dataset, then
    to second and...to third dataset.

    QUESTION:
    A) Did I do something wrong? - I'm sure I did because I'm rookie (amateur).
    B) Is it possible to copy STREETS from 1 dataset to dataset 2 and 3 - and
    does it take much time?
    C) Maybe it is possible to fill one dataset only and connect it to three
    comboboxes and each combox is independent from other...

    I HOPE somebody has understood me and I BEG you for answer.
    THANX from Poland.



  • Cor Ligthert

    #2
    Re: Fill 3 data sets at one time or copy one dataset to another

    Chreo,

    I hope the wether is good in Kiew, :-)

    What you do can be a very fine method. However use dataviews.

    You can than set when the combobox1 changes the datarowfilter for the dataview from combobox1
    and that as well for combobox2 with dataview from combobox1

    Jak chcesz wiecej informacji, napisz, ale po angielsku.

    Cor

    Comment

    • Cor Ligthert

      #3
      Re: Fill 3 data sets at one time or copy one dataset to another

      You can than set when the combobox1 changes the datarowfilter for the
      dataview from combobox1
      and that as well for combobox2 with dataview from combobox3



      Comment

      • chreo

        #4
        Re: Fill 3 data sets at one time or copy one dataset to another

        I haven't use DATAVIEW yet but thanx I will try that as soon as I teach how
        to make dataview :)

        By the way - capital of Poland is Warsaw and I hope that was joke with
        "Kiev" :)


        Comment

        • Cor Ligthert

          #5
          Re: Fill 3 data sets at one time or copy one dataset to another

          Chreo.

          I thought the capital from Poland was Chicago, do you think that somebody
          who gives you an answer in Polish does not know the capital from Poland.
          However I had success with that.

          To show you how you can by instance do it.

          In top of your program
          dim swLoad as boolean

          than where you have filled your datasets

          dim dv1 as new dataview(ds.tab les("firsttable "))
          this 3 times from 1 to 3

          combobox1.datas ource = dv1
          the rest the same as it was
          however as well 3 times

          and then
          swLoad = true

          in the selectedindexch angeevent from the combobox1 (and combobox2)
          \\\
          if swLoad = true then
          dv2.rowfilter = "myfield = '" & combobox1.selec tedvalue.tostri ng & "'"
          end if
          ///

          I hope this helps,

          Cor


          Comment

          • chreo

            #6
            Re: Fill 3 data sets at one time or copy one dataset to another

            Yeah!
            It loads about 40% faster.
            It was 15sec earlier and now is 8-10sec... :)

            Now I must find out what to do to not load each dataset every time I refresh
            the form.

            for example:
            I am adding new costumers and when I save one costumer then the form opens
            again to add another costumer.
            What to do to only update rows in dataset which were not in that datasets
            earlier.
            (for example there was dataset with NAMES and I added new NAME when 1st
            costumer was saved,
            now I want only update dataset with this one NAME and not all table NAMES
            again)


            Comment

            • chreo

              #7
              Re: Fill 3 data sets at one time or copy one dataset to another

              Anyone can help me with speeding my form?


              Comment

              Working...