473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.

Nov 21 '05 #1
6 1672
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

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
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.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,

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework...
7
by: Terry | last post by:
I've got a situation where I have a set of data, and later take another snapshot to obtain a second set of data. There will be one or more changes in the second set of data and I need to be able...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
1
by: Siegfried Heintze | last post by:
I'm using a third party hosting service. I presently have a Web Service on this hosting service's server that loads and executes a native mode DLL. This demonstrates that the hosting service has...
6
by: Brian Henry | last post by:
What is the best way to pass a data set between objects? I have a custom control which will depend on a dataset (kind of like a bound contorl, but im handleing it differently) is it best to pass as...
0
by: Marcin Podle¶ny | last post by:
Hello! I use DataGrid which displays data in several columns. Number of columns depends on user prefferences (I mean: this is still the same query filling datatable but I use...
5
by: moondaddy | last post by:
I have a website where cataloge pages are populated by calling a stored procedure on sql server. I use the sql data adapter's fill method to call this stored procedure and fill the dataset. about...
6
by: Ben Finney | last post by:
Howdy all, Summary: I'm looking for idioms in unit tests for factoring out repetitive iteration over test data. I explain my current practice, and why it's unsatisfactory. When following...
2
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.