473,545 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSource Memory Usage Question

If i connect to my database and select all tables and views. Then I drag a
few differnt tables onto differnt tabs on the same form. I know that the
data isn't bound until the tab header is clicked. Yet is the entire
datasource brougth into ram or just the table (or tables that are in the
view)?

What I'm wondering is if I should create multiple data sources for each
particular form to save memory usage or not?

Thanks,
Apr 27 '06 #1
4 1257
Hi,

When you drag and drop from the data source window to the form designer, a
line of code in Form_Load event handler will be generated by the designer.

// TODO: This line of code loads data into the
'northwindDataS et.Products' table. You can move, or remove it, as needed.
this.productsTa bleAdapter.Fill (this.northwind DataSet.Product s);

This indicates the data is filled to the DataSet at form load time. If you
have multiple tables, multiple sets of these rows will be generated. You
can move these Fills to other places, if you would like to save memory
usage. HTH.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 28 '06 #2
Greg,

In addition to Kevin, the datasource approach with the wizard gives you a
quick start.

Probably is it better to build your datasets in a way, that it only has the
needed data in memory. (Using the Where clauses).

That gives you beside better use of memory a better way of using the
whatever datalines, but also easier way to avoid concurrency errors.

I hope this helps,

Cor

"Greg P" <gs*@newsgroups .nospam> schreef in bericht
news:B3******** *************** ***********@mic rosoft.com...
If i connect to my database and select all tables and views. Then I drag
a
few differnt tables onto differnt tabs on the same form. I know that the
data isn't bound until the tab header is clicked. Yet is the entire
datasource brougth into ram or just the table (or tables that are in the
view)?

What I'm wondering is if I should create multiple data sources for each
particular form to save memory usage or not?

Thanks,

Apr 28 '06 #3
Cor,

That was exactly what I was wondering. I want to keep the memory usage
down. So are you recomending multiple data sources or are you sugesting to
edit the select query and used paramaters? I'm thinking you are suggesting
parameterized queries but wanted to make sure I understood.

Thanks

"Cor Ligthert [MVP]" wrote:
Greg,

In addition to Kevin, the datasource approach with the wizard gives you a
quick start.

Probably is it better to build your datasets in a way, that it only has the
needed data in memory. (Using the Where clauses).

That gives you beside better use of memory a better way of using the
whatever datalines, but also easier way to avoid concurrency errors.

I hope this helps,

Cor

"Greg P" <gs*@newsgroups .nospam> schreef in bericht
news:B3******** *************** ***********@mic rosoft.com...
If i connect to my database and select all tables and views. Then I drag
a
few differnt tables onto differnt tabs on the same form. I know that the
data isn't bound until the tab header is clicked. Yet is the entire
datasource brougth into ram or just the table (or tables that are in the
view)?

What I'm wondering is if I should create multiple data sources for each
particular form to save memory usage or not?

Thanks,


Apr 28 '06 #4
Greg,

You understood what I wrote, but it is up to do what you want,

At the moment I am busy with something that is about one database table.

It use a full datatable with only the fields that I need for the combobox,
the only thing I do with that is fill it and update it internally according
to the other changes. It goes never as update table to the server. I saw
today a bug in this (I will report it). On such a table you can do
acceptchanges as often as you want, often does this than have the effect
that you pass bugs or whatever strange thing..

From that I get what I need in another table with all fields where the
*where* parameter is in this case the selectedvalue. That dataset that I get
I use to work with, to delete from to update from etc.. The delete can of
course easier, but I miss than the simple concurrency checks which is in the
dataadapter etc.

That selection table can of course be more tables if it is a very huge table
to make it the user possible to select in times but not have to go throught
that whole table.

I hope this gives an idea.

However how you do it, it is up to you AdoNet offers you in my idea
thousands of possibilities.

Cor

"Greg P" <gs*@newsgroups .nospam> schreef in bericht
news:A7******** *************** ***********@mic rosoft.com...
Cor,

That was exactly what I was wondering. I want to keep the memory usage
down. So are you recomending multiple data sources or are you sugesting
to
edit the select query and used paramaters? I'm thinking you are
suggesting
parameterized queries but wanted to make sure I understood.

Thanks

"Cor Ligthert [MVP]" wrote:
Greg,

In addition to Kevin, the datasource approach with the wizard gives you a
quick start.

Probably is it better to build your datasets in a way, that it only has
the
needed data in memory. (Using the Where clauses).

That gives you beside better use of memory a better way of using the
whatever datalines, but also easier way to avoid concurrency errors.

I hope this helps,

Cor

"Greg P" <gs*@newsgroups .nospam> schreef in bericht
news:B3******** *************** ***********@mic rosoft.com...
> If i connect to my database and select all tables and views. Then I
> drag
> a
> few differnt tables onto differnt tabs on the same form. I know that
> the
> data isn't bound until the tab header is clicked. Yet is the entire
> datasource brougth into ram or just the table (or tables that are in
> the
> view)?
>
> What I'm wondering is if I should create multiple data sources for each
> particular form to save memory usage or not?
>
> Thanks,


Apr 28 '06 #5

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

Similar topics

6
3252
by: Tom | last post by:
We have a VERY simple .NET C# Form Application, that has about a 23MB Memory Footprint. It starts a window runs a process and does a regular expression. I have done a GC.Collect to make sure that, no memory is lying around. GC reports only 84k of allocations. Starting 5-10 of this apps is going to start taking a considerable amount of memory....
3
4118
by: Ian Taite | last post by:
Hello, I'm exploring why one of my C# .NET apps has "high" memory usage, and whether I can reduce the memory usage. I have an app that wakes up and processes text files into a database periodically. What happens, is that the app reads the contents of a text file line by line into an ArrayList. Each element of the ArrayList is a string...
7
5177
by: George Gre | last post by:
Hi, I wrote a c# programme that listens to incoming TCP requests and services them. This programme is meant to be running as long as the server its installed on is running. So we assume for ever(!). My problem is that I have it running for 2 days now on my pc (win2Ksp3 P4 2GHz,512MB Ram - framework v1.0.3705) and the taskmanager reports...
5
3139
by: SDS | last post by:
I am writing an ASP.NET application (in C#) that, as part of a particular response, populates a MemoryStream object with binary data that is being collected from a Process object's StandardOutput. This data can be between 60MB and 100MB under normal circumstances. I write this data to the response stream. I'm noticing that calls to this...
8
1873
by: TheB | last post by:
Ok, lets try this again. I have a program which searches all disk drives for certain file types. When it finds a file it writes a record to a Firebird DB. The program normally is using 40 - 44 megs. However after running for about a minute the memory usage suddenly jumps up to 440 - 450 megs for about 15 - 20 seconds and then instantly...
11
5916
by: Rares Vernica | last post by:
Hi, What is the right way/tool to find the peak memory usage of a C++ program? I tried Valgrind but is does not seem to be able to answer my question. Thanks a lot, Ray
3
2454
by: crazy420fingers | last post by:
I'm running a python program that simulates a wireless network protocol for a certain number of "frames" (measure of time). I've observed the following: 1. The memory consumption of the program grows as the number of frames I simulate increases. To verify this, I've used two methods, which I invoke after every frame simulated:
1
2024
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after the objects for which that memory was allocated are no longer live in the process. This is only a leak if peak memory goes up again each time you...
12
2984
by: David Given | last post by:
I have a situation where I need to be able to allocate chunks on unmapped virtual memory. Because the memory I'm allocating isn't mapped, I can't use a normal memory allocator, as most of them want to store their metadata about the free list in the unused holes in the heap. Instead, I need a memory allocator that stores its metadata...
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7921
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3465
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1900
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
720
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.