|
He just did. he told you how to do it.
As has been said a thousand times, we'll help you do your homework but we wont do it for you!
|
|
|
|
|
With a little bit of thought you shouldn't need a loop at all. The real question is do you want to display the results, pre-order or post-order?
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
please help me if yiou have time. I have a big hope on this forum. I am entry level and not sr like you. please help and God will give it on return.
|
|
|
|
|
God helps those that help themselves. This isn't a Senior Developer problem, this is a trivial Freshman Comp Sci question that everyone gets in the first month of the course. Asking us for the answer is cheating and grounds for dismal at every University in the United States. How is giving you the answer helping anyone?
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: How is giving you the answer helping anyone?
By getting him kicked out of school for cheating, we won't have to clean up his 'work' after he graduates.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
What about inorder?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yeah, I wrote that the first time, and then couldn't remember if it was the same as pre-order. Rather than looking it up I just deleted it. Error's of omission aren't as bad inaccuracies I suppose.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
nesfrank wrote: give me some sample code
No. This is a very basic computer science problem that is found in most intro programming courses, thus reeks of homework. Try doing it yourself and when stumped on a part of your own written code, then ask for help.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Good to see you again, professor
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I want to write C# application that will log on to web page with provided user name and password.
Any hint on this!
Thanks,
Perry
|
|
|
|
|
Then you need to keep the session identity from one request to the next. Get the cookies collection from each response and use in the next request that you make.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi
the following code reduce my available memory
and increase my Application memory usage up to 300MB
(when it repeat each 200 times)
what can i do ?
tanks in advance
public static void ResetLocalDB()
{
using (SqlDataAdapter Adapter = new SqlDataAdapter("select * from LocalDB", LocalConnection))
{
Adapter.Fill(LocalDataSet, "LocalDB");
}
}
|
|
|
|
|
reza assar wrote: the following code reduce my available memory
Running ANY code will do this. Why is it a problem? 300MB is not a lot of memory to use.
reza assar wrote: (when it repeat each 200 times)
So don't do it 200 times
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Garbage collection doesn't happen immediately. When it does the amount of allocated memory your application is using will decrease. Because allocating/returning memory from/to the OS is a relatively expensive process, your app won't do so immediately. Eventually if you don't use it the memory manager will decide ti doesn't need that much and return it. If your OS is getting low on memory it will ask if your app can return some and it will do so then, if your OS was low on memory when this was going on you'd've had a GC collect during the middle of your memory hogging exercise and the peak would never have gotten that high. There're some system events that will do the same (minimizing is one of them).
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Are absolutely sure that it reduces the available memory, or are you just looking in the Task Manager at how much memory the memory management system has allocated?
It's normal for an application to allocate memory that you use, and not release it until it is actually needed for something else.
Do you dispose the database connection correctly?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi
at first thanks for your attention
yes i looked at task manager
but it wont release my ram memory until i close the application
it wont release even when i dispose my object explicitly
please explain me more about that
do you mean that i have not to be worry about that 300MB of ram ?
it`s so expensive !!!!
|
|
|
|
|
reza assar wrote: yes i looked at task manager
but it wont release my ram memory until i close the application
What you see in the task manager is how much memory the memory manager has allocated, not how much memory is actually used.
reza assar wrote: it wont release even when i dispose my object explicitly
You should always dispose objects that are disposable. That's how you control the life cycle of the object. Disposing objects however doesn't mean that their memory is reclaimed, that is done by the garbage collector when it's convenient or when it's needed.
If the garbage collector would reclaim the memory for every single object that is released, your program would run much slower. To free a few bytes the garbage collector would have to move several megabytes around in memory just to align the objects continuously in memory.
reza assar wrote: do you mean that i have not to be worry about that 300MB of ram ?
it`s so expensive !!!!
You don't have to worry. Unless you have done something wrong, the memory will be reclaimed if it's needed. If you minimise the program you should see how it reacts when the system tells it to make an effort to release memory.
The way that the .NET framework handles memory seems expensive only as you are focusing on the amount of memory allocated. A computer doesn't run better if it has a lot of unused memory. On the contrary, it would be more expensive to move the objects around in memory all the time so that you could release every single byte of unused memory to the system, only to make it look better in the task manager.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
reza assar wrote: my Application memory usage up to 300MB
That's not out of the ordinary
reza assar wrote: select * from LocalDB
Is it necessary for your program to be fetching all fields from all records in the LocalDB table?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hi
at first thanks for your attention
i want to have changes in my DbGrid immediately do you offer a god way
it wont release my ram memory until i close the application
it wont release even when i dispose my object explicitly
please explain me more about that
do you mean that i have not to be worry about that 300MB of ram ?
it`s so expensive !!!!
|
|
|
|
|
reza assar wrote: do you mean that i have not to be worry about that 300MB of ram ?
No worries about the actual ram. If the system runs out, then it'll go to virtual memory on the hard drive. As slow as that is, it's better than nothing.
Take a closer look at the requirements of your program and see where you can trim out unneeded data ( such as fields you are not working with)...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hi,
i have question i need to check from exchange server which message was read last time by user, and i wonder how can i check it programmitcaly using c# and mapi33 library, this infromation is in some tag's?
thanks a lot
|
|
|
|
|
Bitmap bm = new Bitmap(@"C:\LEGO.jpg");
Graphics gr = Graphics.FromImage(bm);
gr.DrawEllipse(Pens.AliceBlue, new Rectangle(5, 5, 50, 50));
gr.Dispose();
bm.Save(@"C:\LEGO.jpg");
Error:
System.Runtime.InteropServices.ExternalException was unhandled
A generic error occurred in GDI+.
I know the loaded bitmap file is still locked and there will be no error if saved with a different name, but I want to apply my changes to the same file, is it doable?? How??
Many thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
You can save it with different name, delete old one and rename the one you created.
|
|
|
|
|
You can user the "Clone()" function to get a new bitmap object and dispose the original one.
some thing like:
Bitmap bm = new Bitmap(@"C:\LEGO.jpg");
Bitmap tmp = bm.Clone();
bm.Dispose();
Graphics gr = Graphics.FromImage(tmp);
gr.DrawEllipse(Pens.AliceBlue, new Rectangle(5, 5, 50, 50));
gr.Dispose();
tmp.Save(@"C:\LEGO.jpg");
hope this helps.
regards
|
|
|
|