Make control static.
public static Calender clndr = new Calender();
User Profile
Collapse
-
Below code can be used for copying combobox items in an array.
Code:string[] strArray = new string[comboBox1.Items.Count]; for (int i = 0; i < comboBox1.Items.Count; i++) { strArray[i] = comboBox1.Items[i].ToString(); }
Leave a comment:
-
SystemState.Con nectionsDesktop Count already returns an integer value, so it is useless to call Convert.ToInt32 ()
In case when return-type is not known, use TryParse() method.
TryParse() returns bool value.
Code:int desktopCount = 0; if(Int32.TryParse(SystemState.ConnectionsDesktopCount, out desktopCount)) { //true } else { //false }
Leave a comment:
-
Use DirectorySecuri ty, FileSecurity class to set permission.
To shutdown system from c#
Code:ProcessStartInfo pinfo = new ProcessStartInfo("shutdown", "-s"); Process proc = new Process(); proc.StartInfo = pinfo; proc.Start();
Leave a comment:
-
-
Yes, second method will running under the same thread(thread from which it was called). Once the execution of thread method completes, thread stops(stop state).Leave a comment:
-
You can easily create .msi setup in visual studio. Select "setup and deployment" in project type.Leave a comment:
-
- In project properties > Settings
- create a property with Name as USER and Type as String.
To set and get this property use below code:
Code://Store value in USER property from txtUser TextBox Properties.Settings.Default.USER = txtUser.Text; Properties.Settings.Default.Save(); //Read USER property in a variable username string username = Properties.Settings.Default.USER;
Leave a comment:
-
-
Create a parameterized stored procedure in sql server which performs above query within transaction block. Execute that stored procedure from your application with parameter values.
In this case only single SqlCommand object is required and you can take advantages of stored procedures.Leave a comment:
-
-
-
Set MultipleActiveR esultSets property to True in connection string.Leave a comment:
-
-
Spelling mistake, change valuse to values and command is not well formed. Check syntax of command string (" ' "+ txtname.Text... ........Leave a comment:
-
Practice by developing applications. It will help you in exploring and understanding language in depth.Leave a comment:
-
You need to call RunWorkerAsync( ) method of backgroundworke r to fire doWork event.Leave a comment:
-
-
Simplest way is to upload an xml file on server which contains details regarding latest version, download link, size, etc. Download this file from your application and check the current version with the version in downloaded xml file.
Next time whenever you release new updates, just update xml file.Leave a comment:
-
There is an error in the value of your Filter property.
No need to use + operator and , comma is missing.
It should be like,
Code:OpenFileDialog.Filter = "xml files (*.xml) |*.xml, *.xsl";
To get selected file in textbox,
Code:Textbox.Text = OpenFileDialog.Filename;
Leave a comment:
No activity results to display
Show More
Leave a comment: