|
Pete O'Hanlon wrote: not sure there's intelligent life there.
Basing on how well formed the inquiry was, I am sure you are right on
"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
|
|
|
|
|
1. You shouldn't use the default variable names. ListBox1 tells you nothing about the purpose of the listbox, and is unmaintainable - rename it to something more appropriate such as theProgrammerWhoPutThisListBoxInIsACompleteMoronWhoMustBeHuntedDownBeforeHeGetsTheChanceToReproduceNotThatHeStandsMuchOfAChanceOfMating.
2. Don't post snippets here. This forum is for questions, it's not notepad.
3. See suggested variable name in 1.
|
|
|
|
|
You got my 5 for the variable name. Hope you don't mind if I borrow for my next project
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Feel free. And while you're at it, ask her if she's got a sister.
|
|
|
|
|
Pete O'Hanlon wrote: ask her if she's got a sister
LMFAO!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi all. In my application i have one data table what can be binded to control on one form and can be filled on another form.
<br />
<br />
this.cLIENTBindingSource.DataSource = this.dataSet1.CLIENT;<br />
<br />
....<br />
<br />
this.comboBox1.DataSource = this.cLIENTBindingSource;<br />
<br />
In proper moment i press a button to make refilling of CLIENT data table.
<br />
private void simpleButton1_Click(object sender, EventArgs e)<br />
{<br />
this.cLIENTTableAdapter.Fill(this.dataSet1.CLIENT);<br />
}<br />
In this case all work fine!
But when i bind this data table to control on one form and fill this one on other form like this:
Form 1:
<br />
<br />
this.cLIENTBindingSource.DataSource = this.dataSet1.CLIENT;<br />
<br />
....<br />
<br />
this.comboBox1.DataSource = this.cLIENTBindingSource;<br />
<br />
....<br />
<br />
private void simpleButton1_Click(object sender, EventArgs e)<br />
{<br />
Form2 form2 = new Form2();<br />
<br />
Form2.Show(this.cLIENTTableAdapter, this.dataSet1.CLIENT)<br />
}<br />
<br />
Form 2:
<br />
<br />
private void simpleButton1_Click(object sender, EventArgs e)<br />
{<br />
_dataAdapter.Fill(_dataTable); <br />
}<br />
<br />
internal void ShowDialog(System.Data.Common.DbDataAdapter DataAdapter, System.Data.DataTable DataTable, System.Windows.Forms.BindingSource BindingSource)<br />
{<br />
<br />
_dataAdapter = DataAdapter;<br />
<br />
_dataTable = DataTable;<br />
<br />
this.ShowDialog();<br />
}<br />
In this case all sad. Fill is make vary slow and even may fail. Where is problem here and what i can do to resolve it???
THANK
|
|
|
|
|
This doesn't quite make sense.
In case 1 you fill dataset and in case 2 you fill datatable. Also in case 2 the code is executed based on user input (button click) so it's not immediate.
Perhaps you should explain a little bit more what you are trying to achieve.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
This just a sample.
Actually i use one static dataset in my application and can display in two diffrent windows forms (suppose parent and child) same data table in the same time, all work fine, till i start to fill this data table in one form, in this case Fill operation are maked very slow. But when i use so one form and fill data table exatamente in it all work fine. Example above just describe this situation.
|
|
|
|
|
There could be two reasons. Either the statement used for fill is slow or the existing binding is making it slow. Before filling the dataset, remove any bindings to it and rebind after the fill. Perhaps that would help.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Yes its a solution. But why when i fill this table in the same form where binded my control (either without rebinding) all work fine, but when in another all work very slow????? Thats the Point.
modified on Monday, October 27, 2008 3:52 AM
|
|
|
|
|
As I said in the first post, the scenarios are not the same.
In your first example you fill the dataset. So it seems that you don't have a datatable in the dataset, but it's created during fill.
In the second example, you already have a datatable and you're filling it. So it makes me wonder if you have existing event handlers, binding etc. attached to the datatable. If so, they can be the cause to the slow fill. Especially if binding is involved since existing binded objects must be refreshed when binding is done. This wouldn't be the case in example 1.
Without seeing the actual situation, it's merely guessing. However, the filling speed should be equal in both cases if the query is the same and the 'surroundings' are the same (eventhandlers etc)
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello everyone,
I am designing an application which could be treated as a framework application to host other components, e.g. functions like component life cycle management and delegate from client to call the components.
Now I have two design patterns, and I want to ask for advice about which one is better and why.
Design pattern 1, using interface, for example, let client application impement interface, which contains method called Initialization, and my application framework call Initialization method when I want to initialize a component;
Design pattern 2: using event for example, OnIntialize event, client application register event handler (callback), and when my application framework wants to initialize a component, I will send OnInitialize event.
Any advice?
thanks in advance,
George
|
|
|
|
|
I like design pattern 1 based on the Kiss principle.
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.
|
|
|
|
|
Besides this, are there any technical reasons why you prefer option 1?
regards,
George
|
|
|
|
|
George_George wrote: I am designing an application which could be treated as a framework application to host other components
Get real. Based on your collection of threads here in CodeProject that is a task well, Well, WELL beyond your current understanding of software development fundamentals.
led mike
|
|
|
|
|
led mike wrote: Get real.
That's every bot's dilemma, isn't it?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Damn near pulled muscle laughing at that one!
led mike
|
|
|
|
|
Do you have any advice or comments to my original question?
regards,
George
|
|
|
|
|
I do not quite understand what do you mean "Get real"? Could you say some other words please?
regards,
George
|
|
|
|
|
Whatever dude. Disagree with me all you want, you have a far better grasp of the subject than I do.
led mike
|
|
|
|
|
Hi led mike,
Could you provide some technical advice or comments please?
have a good weekend,
George
|
|
|
|
|
Hi alll,
How to scroll a listview with out scroll bar. I know
ListBox1.EnsureVisible(index) will do the job, but since i have disabled Scrollable property using
ListBox1.Scrollable = false EnsureVisible is not doing the job.
is there any other way to scroll listview with scrollable propery set to false
Regards
Vayanans
|
|
|
|
|
I don't think of any idea in c# windows application. But if you could explain your scenario a bit, perhaps i could be able to give you any suggestion.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
hi
I dont want to use scroll bar to scroll the listview. i have two buttons for scrolling u and down
is there is any way to do so...?
Regards
Vayanans
|
|
|
|
|
you should make a user control like listview by using textboxes for example. Then put your own buttons for moving it up or down.
Ahsan Ullah
Senior Software Engineer
|
|
|
|