By default, when virtual machine is created on Hyper-V host, its clock is "bound" to the virtualization host operating system clock via Hyper-V integration services. If there are two or more virtualization hosts in the same network, it may happen the operating system time on one of the hosts to be different comparing to another host.
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.
TUTORIALS | .NET FRAMEWORK | C# | C SHARP | WINDOWS FORMS | WINFORMS
Microsoft .NET FrameworkMicrosoft .NET Framework is technology for building and running .NET applications. It provides a standard library of classes and a run-time environment called Common Language Runtime (CLR).CLR is the foundation of the .NET Framework.
Sometime, sysprep operation may fail with the following error message:
System Preparation Tool 3.14A fatal error occurred while trying to sysprep the machineDetails can be found on Microsoft web site https://support.microsoft.com/en-us/kb/2769827
The quick fix is available here
C# Combobox defined with name my_combobox
private System.Windows.Forms.ComboBox my_combobox;Read the text of the selected combobox item and assign it to string variable, then show it in message box.
string selected_item_text = my_combobox.GetItemText(my_combobox.SelectedItem);MessageBox.Show(selected_item_text);
When ASP application is published to IIS using LocalDB accessing the database may result in the following error:
Server Error in '/Application_Name' Application.A network-related or instance-specific error occurred while establishing a connection to SQL Server.
Visual Studio .NET provides a user-friendly graphic designer for building user interfaces. With it, within a few minutes, a user interface design can be built, whether it's a Windows Forms window, a Web page, or a mobile application interface
CompilationWhen compiling, VS.NET automatically creates the required assemblies and resource files.
To get only the unique /distinct/ data table records from any database connected to DataSet in C# project and to put them inside combobox.Fill the table adapter with the records from database.
this.myDBTable_TableAdapter.Fill(this.myDB_DataSet.myDBTable);Create a view containing the database table
DataView view = new DataView(this.myDB_DataSet.myDBTable);Copy only the distinct records to new data table.
To return the latest record (one record only) from data base table where one of the fields is in Date/Time format:
SELECT TOP 1 * FROM table_name ORDER BY date_time_column_name DESCNotes:
- for ORACLE instead of TOP 1, ROWNUM shall be used
- the query may return NULL value - suitable exception handling must be provided
C# Combobox defined with name my_combobox
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
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
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.
C# project with two forms
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 variablein Form1 inside the function that run (call) Form2
In order to draw shapes in C# a start point and end point coordinates, and a Pen control must be defined first.
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.
The creation of custom control using Visual Studio involves the following steps:
- Start Visual Studio;
- Create new “Windows Control Library” project;
- In the created project delete “User Control” file;
- Go to “Project” > “Add User Control” and give it a name;
- Change the inherited class to this that you want your control to be;
- Create you custom properties for the control;
- Compile the project: Go to “Build” > “Build Solution”;
To add a custom control to VisualStudio project:1) Go to “Toolbox” tab;2) Right click on it and click “Choose Items…”;
3) In the “Choose Toolbox Items” window click on the “Browse…” button.Navigate to the location where your Dynamic Link Library (DLL) file is.Click “OK”. Now your custom control is included into the Visual Studio toolbox.
Today 5 January 2017 MBM Project starts migration to purposely build web site & blog platform based on MS ASP .NET & C# . Some of the old pages with obsolete information will be dropped. Some will be kept for reference. During the migration due to different platforms the information in the old articles might be partially lost or with changed formatting. Users' comments will not be transferred to the new site.