473,383 Members | 1,759 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,383 software developers and data experts.

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 1249
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
'northwindDataSet.Products' table. You can move, or remove it, as needed.
this.productsTableAdapter.Fill(this.northwindDataS et.Products);

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**********************************@microsof t.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**********************************@microsof t.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**********************************@microsof t.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**********************************@microsof t.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
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,...
3
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...
7
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...
5
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. ...
8
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...
11
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
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...
1
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...
12
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.