PROGRAMMING HELP | 2017/10/05 02:52
private System.Windows.Forms.ComboBox my_combobox;
Define string variable with the text of the combobox item that has to be selected. For example, if the combobox items have text values "item_a" "item_b" "item_c" ... and the item which text is "item_b" has to be selected
PROGRAMMING HELP | 2017/10/05 02:45
To get the database connection string from IIS Web.config file using C# code, include System.Configuration directive and then create a string variable to assign the connection string like this:
using System.Configuration; string connStr = ConfigurationManager. ConnectionStrings["connectionString_Name"].ConnectionString;If “ConfigurationManager” is not recognized you will need to add reference to: "System.Configuration".See: C# - How to add reference to project
PROGRAMMING HELP | 2017/10/05 02:27
To prevent users from entering incorrect data in Windows form application, set restriction to allow only specific characters to be entered in the text box.This example uses KeyPress event to monitor the users input and to apply the restriction required.To avoid code duplication in Windows multiform applications for example, a separate class file is created “CommonFunctions.cs”.
The function to allow only numbers in textbox control is named InputNumbers.
For each Windows form, create a single KeyPress event and call the InputNumbers function inside it.
PROGRAMMING HELP | 2017/10/05 02:07
public partial class Form1 : Form // this is the main form public partial class Form2 : Form // this is the second formTo pass variables (values, data) from Form1 to Form2
Case: public variables in Form2
public string input_variable; // put this in Form2 as global variable public string output_variable; // put this in Form2 as global variable
in Form1 inside the function that run (call) Form2
PROGRAMMING HELP | 2017/10/05 01:56
Coordinates in C#The value of x is the location of the point along the x-axis, the 0 is at the extreme left. The value of y is the location of the point along the y-axis, the 0 is at the extreme top.
CAD/CAM | 2013/12/09 14:48
DB platform: MS SQL server
Product: SmartMarine 3D, SmartPlant 3D (SM3D, SP3D)
Task: Get list of deleted objects by specific user or/and on specific date and time
A list of the deleted objects is avalable from project's Reports database ( xxxx_RDB ).
PROGRAMMING HELP | 2013/10/19 11:10
using System.DirectoryServices.AccountManagement; string userName = SystemInformation.UserName; string UDN = SystemInformation.UserDomainName; string domainUser = UDN + "\\" + userName; PrincipalContext pc = new PrincipalContext(ContextType.Domain); UserPrincipal user = UserPrincipal.FindByIdentity(pc, IdentityType.SamAccountName, domainUser); GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, "Domain_Group_Name"); bool is_member = user.IsMemberOf(group);
CAD/CAM | 2011/10/16 21:15
The scope of this document is a simplified model comparison based on PDMS Structural Design and TRIBON Hull Design.
The purpose of this document is to give an overview of two 3D- modeling systems and underline the differences between them.