|
Hi Kwagga,
your code is doing several things: getting data, outputting it to a textbox,
summing it. If this takes too long, first thing you should do is find out which
part is responsible, typically by either inserting accurate timing code, or
by disabling some of the parts.
My best guess is the display part is the culprit.
For one thing, you are creating N different strings (N=3500), where each new
string is built with +=, hence needs to copy all the previous content.
And you are telling the txtboxdisplay to update itself N times.
If line wrapping is irrelevant (I guess it is), I strongly recommend you replace
the textbox by a ListBox; a ListBox is very good at displaying a large number of
independent lines of text, it never needs them to be concatenated, and it updates
very fast since it only processes a change, as in ListBox.Items.Add(string) .
|
|
|
|
|
Yeah, I found that it was the displaying of the items. I have cut that bit out of the code cause I don't really require it. It now takes a split second to process 100 000 records.
Thanks again.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
decimal theNum = 12345678901234567890;
ulong theNum2 = 12345678901234567890;
MessageBox.Show(theNum.ToString() + " - " + theNum2.ToString());
-= Reelix =-
|
|
|
|
|
You could use the decimal type.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks mate. I have figured out what the problems was. I was importing the data as Int32 and after changing that to long it worked fine.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
hello frnds,
can i pass optional parameter to C#.NET method like VB.NET ???
if yes then how ???
is there any another option to get it ?
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
No, you cannot. You have to create a chain of methods with less parameters that call the longer methods with the default
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
koolprasad2003 wrote: can i pass optional parameter to C#.NET method like VB.NET
No, you can't.
koolprasad2003 wrote: is there any another option to get it ?
You can make overloaded methods. You can use nullable values.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
May be you can try like htis
public void TestFunc(int requiredParam1,int requiredParam2,parms object[] optionalParms)
{
if(optionalParms.Length > 0)
{
//Do what ever you want.
}
}
Now you can call them like
TestFunc(1,2);
TestFunction(1,2,"Hello");
TestFunction(1,2,"Hello","World");
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
C# doesn't support optional parameters and this can be handled by overloading functions. For an instance consider you want a same method should handle 2 and 4 parameters
private void BindComboBoxWithDataSource(RadComboBox RADComboCtrl,object DataSourceObject)
{
RADComboCtrl.DataSource = DataSourceObject;
RADComboCtrl.DataBind();
RADComboCtrl.Items.Insert(0,new RadComboBoxItem(NOOPTIONSELECTED_TEXT));
}
private void BindComboBoxWithDataSource(RadComboBox RADComboCtrl, object DataSourceObject, string DataTextField, string DataValueField)
{
RADComboCtrl.DataSource = DataSourceObject;
RADComboCtrl.DataBind();
RADComboCtrl.DataTextField = DataTextField;
RADComboCtrl.DataValueField = DataValueField;
RADComboCtrl.Items.Insert(0, new RadComboBoxItem(NOOPTIONSELECTED_TEXT));
}
Udai.m
Solution Architect
|
|
|
|
|
Hi,
I need to create an executable in c# which unchecks the "Automatically Detect Settings" checkbox in Internet Explorer Options, LAN Settngs.
Any Help?
Thanks
|
|
|
|
|
What makes you think that IE exposes that ? If it does, probably it's in the registry.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah, It is in Registry only. I mean how to do that by some exe and which key is that.
|
|
|
|
|
This option is a combination of two Keys in this registry path
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
There are two settings which are changing if you select / deselect the Option "Automatically Detect Settings".
DefaultConnectionSettings
SavedLegacySettings
Hope this helps
Tiefe Brunnen muss man graben wenn man klares Wasser will,
tiefe Wasser sind nicht still.
|
|
|
|
|
Hi Friends,
How to retreive values from .CSV file in C#.Please help me how to do.
Thanks & Regards
Senthil Kumar.T.S
|
|
|
|
|
File.ReadAllText and then the split method to split the string on the , so you get an array of values to parse.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Christian Graus,
Can you give me a example? Please?
|
|
|
|
|
In addition to what CG said, there are quite a few libraries that do this. If you want to do it yourself, make sure you handle cases like the items being enclosed in double quotes. I always do that so I can have spaces and other special characters (including the comma itself) in my items.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Hi Friends,
Can you tell me how to connect .CSV file with C# and retreive the values.As CG said by File.ReadAllText we can split the string and get the method.Can give me a example code so that i can get an idea, because i searched in google but i can't get the solution.
Thanks & Regards
Senthil Kumar.T.S
|
|
|
|
|
|
|
I have set the "Release" configuration for a .NET solution.
Therefore, I expect that the solution will run in "Release" mode.
One problem - I have a third party dll attached and it is complaining about missing the following assembly - Microsoft.VC80.DebugCRT. It appears that Microsoft.VC80.DebugCRT is a "Debug" assembly that I wouldn't expect to get called while in "Release" mode.
So - If I set the "Release" configuration for a .NET solution then will this configguration also apply to any attached third party dlls?
|
|
|
|
|
No, because you don't BUILD your third party dlls, right ? You bought them and you're not building them are you ?
Make sure you copy the release version of the dll to the folder with your release build.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am trying to install a merge module with the following command:
msiexec /a Microsoft_VC80_DebugCRT_x86.msm
My system displays a Windows Installer dialog that says - "Preparing to Install...". Then the dialog disappears.
After this, I go to C:\Program Files\Common Files\Merge Modules\ and the msm does not exist in the directory, although I am expecting it to.
What am I missing?
|
|
|
|
|
I added the merge module to a setup project and the merge module installed successfully.
Has anyone on this forum used msiexec to install merge modules? If so then please take a look at the command in my last post and let me know what might be wrong.
|
|
|
|