|
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.
|
|
|
|
|
Ok, I've got this project which I've been developing for about 9 months now as a .NET web application. I was told today that we're switching gears and it's going to be a Windows app instead. Ok, slight problem. I know exactly two things about Windows app development, Jack and S**t. And guess what, Jack's just left town. So I throw myself upon the mercy of the gurus. Can anybody point me to a good tutorial on WinForms that talks about a multi-form application and using menus to switch between active forms. The only WinForm app ever developed by anyone at work was a small demo app that had two forms with a button on form 1 to hide form 1 and show form 2, then a button on form 2 to hide form 2 and show form 1.
I've tried googling for some tutorials and I'm coming up with nothing helpful. Anyone got any ideas?
|
|
|
|
|
Well, the main thing is, you just show a form by creating an instance of it and then calling ShowDialog or Show, depending on if you want it to be modal or not.
If your main form switches between forms, I'd create them as controls, put them all on the form, and swap which one is visible.
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 )
|
|
|
|
|
Christian Graus wrote: create them as controls, put them all on the form, and swap which one is visible
That's what the demo app I've got does. But this app is going to be a few hundred forms. It's going to be a replacement for four individual MS Access applications and we're rolling them all into one app as the departments that used them have been consolidated into one. I was hoping to be able to create a menu with some sort of method for showing/hiding controls and when the user clicks on a menu item that control shows and the currently visible one hides. Does that sound reasonable?
|
|
|
|
|
FyreWyrm wrote: Does that sound reasonable?
Yeah, the way I'd do that is, have an enum of forms, store the enum for the form you want in the tag, then write a method that you call which hides all forms, then shows the one specified by the enum value. So, you have one menu click event, which reads the tag, then turns it into an enum and calls one method that is always responsible for setting the visible form.
You can just iterate over the controls collection to hide your controls. You could even have the controls that are the forms have the same tag values so one function checks each controls tag and works out which one to show, no switch or anything needed.
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 )
|
|
|
|
|
Thanks Christian. I appreciate your help. I'm going to look into this more when I get to work tomorrow.
|
|
|
|
|
Cool - just post again if you get stuck.
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 )
|
|
|
|
|
Actually what you need is a WinForm with one main form and every form will be shown in the main form, one at a time, right?
You can create the forms as per normal, and instead of calling Show(), do the following instead. The form will be shown in the body of main form.
Form2 form = new Form2();
form.FormBorderStyle = FormBorderStyle.None;
form.TopLevel = false;
mainForm.Controls.Add(form);
form.Show();
|
|
|
|
|
Cool - so that basically adds the forms as controls, it's another path to what I was saying ?
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 )
|
|
|
|