Search This Blog

Wednesday, October 8, 2014

APP_NAME SQL Server Example

SQL Server > Built-in FunctionsAPP_NAME

APP_NAME returns the application name for the current session.

Example:

select APP_NAME();
Result:
Microsoft SQL Server Data Tools, T-SQL Editor



Create form in runtime C#

C# > Windows > Form

A Form is a representation of any window displayed in your application.

Properties
Example

Create form in runtime

Form form1 = new Form();
Button button1 = new Button();
button1.Text = "OK";
button1.Location = new Point(5, 5);
form1.Text = "My Form";
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);

form1.ShowDialog();




Jenkins Email Error: Network is unreachable

Jenkins > Email > Network is unreachable error

send failed, exception: javax.mail.MessagingException: Could not connect to SMTP host:     , port: 25;
nested exception is:  java.net.SocketException: Network is unreachable: connect


Solution:

The problem is because java 1.7 uses IPv6 by default.
To fix this add Java Option from command line:

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true**




Tuesday, October 7, 2014

Set Next Build Number Jenkins

Jenkins > Next Build Number

Install plugin Next Build Number

https://wiki.jenkins-ci.org/display/JENKINS/Next+Build+Number+Plugin

After install you have to reload configuration from disk


Go to configure project and click on Set Next Build Number





Friday, October 3, 2014

ProcessStartInfo Example - Start Microsoft Word

C# > DiagnosticsProcessStartInfo

ProcessStartInfo specifies a set of values that are used when you start a process.

Example 

Start word

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "WINWORD.EXE";
Process.Start(startInfo);






Process Class C#

C# > Diagnostics > Process Class

A process is a running application.
Process class provide access to a process that is running on a computer. 
The Process component is a useful tool for starting, stopping, controlling, and monitoring apps.

Methods:






System.Diagnostics Namespace C#

C# > System.Diagnostics

System.Diagnostics contains classes that allow to interact with 

  • system processes
  • event logs
  • performance counters
Classes