Search This Blog

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





    Tuesday, September 30, 2014

    SqlClient namespace

    C# > System.Data  > SqlClient

    SqlClient namespace is the.NET Framework Data Provider for SQL Server.





    SqlBulkCopy C# SQL Server import data example

    C# > System.Data  > SqlClient > SqlBulkCopy

    SqlBulkCopy efficiently bulk load a SQL Server table with data from another source.
    The data source is not limited to SQL Server, any data source can be used.
    SqlBulkCopy offers a significant performance.






    Example:

    string sourceConnectionString = "YourSourceConnectionString";
    string destinationConnectionString = "YourDestinationConnectionString";

    using (SqlConnection sourceConnection =
           new SqlConnection(sourceConnectionString))
                {
                    sourceConnection.Open();
                    SqlCommand commandSourceData = new SqlCommand(
                        "SELECT * FROM source_table;", sourceConnection);
                    SqlDataReader reader = commandSourceData.ExecuteReader();
                    using (SqlConnection destinationConnection =
                               new SqlConnection(destinationConnectionString))
                    {
                        destinationConnection.Open();
                        using (SqlBulkCopy bulkCopy =
                                   new SqlBulkCopy(destinationConnection))
                        {
                            bulkCopy.DestinationTableName = "dbo.destination_table";
                            try
                            {
                                bulkCopy.WriteToServer(reader);
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                            }
                            finally
                            {
                                reader.Close();
                            }
                        }
                    }

                }




    Monday, September 29, 2014

    GetDrives C# Example

    C# > Files > DriverInfoGetDrives 

    Retrieves the drive names of all logical drives

    Example:
    DriveInfo[] allDrives = DriveInfo.GetDrives();

    foreach (DriveInfo d in allDrives)
    {
       tvLeft.Nodes.Add(d.Name);  
    }