470,634 Members | 2,029 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,634 developers. It's quick & easy.

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.

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.

Nov 21 '05 #1
6 1592

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.


Nov 21 '05 #2
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

Nov 21 '05 #3
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" :)
Nov 21 '05 #4

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.tables("firsttable"))
this 3 times from 1 to 3

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

and then
swLoad = true

in the selectedindexchangeevent from the combobox1 (and combobox2)
if swLoad = true then
dv2.rowfilter = "myfield = '" & combobox1.selectedvalue.tostring & "'"
end if

I hope this helps,

Nov 21 '05 #5
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
(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
Nov 21 '05 #6
Anyone can help me with speeding my form?
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Terry | last post: by
6 posts views Thread by Brian Henry | last post: by
reply views Thread by Marcin Podle∂ny | last post: by
5 posts views Thread by moondaddy | last post: by
6 posts views Thread by Ben Finney | last post: by
2 posts views Thread by slinky | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.