Friday, 30 June 2017

Excel Find all the data which start with XYZ, till next number

Input: Column A-->
ABC-2123-XYZ-023111-Test-2-BOX-US-ZAW

Find all the data which start with XYZ, till next number
Formula:
=MID(A1,FIND("-XYZ",A1)+1,10)

Friday, 23 June 2017

Copy SQL tables in to new data base



I have a SQL DB name Test
table names are Tbl_1, Tbl_2
Now i would like to create new DB with same tables from Test

Create new DB Test_Copy
Create new query from Test_Copy DB
Now run below query to create tables with data

 select * into [dbo].[Tbl_1] from [Test].[dbo].[Tbl_1]
 select * into [dbo].[Tbl_2] from [Test].[dbo].[Tbl_2]

Wednesday, 21 June 2017

Excel find duplicate rows

=countif(M:M, M2)

if you get 1 mean, row is coming 1 time, if it is 2,3,4.... mean, duplicate records are there

Friday, 2 June 2017

ASP.net MVC WEB API Angular 2

http://ecollabro.codeplex.com/SourceControl/latest
http://webapiclientgen.codeplex.com/SourceControl/latest

WEB API, Angular 2

ASP.NET MVC Sample App

ProDinner - ASP.NET MVC Sample App

http://prodinner.codeplex.com/

using .net 4.5, ASP.net MVC, EntityFramework
CRUD and search operations for entities
very rich and responsive UI (using ASP.net MVC Awesome jQuery Ajax Helpers)
upload and crop Images for meals (using Jcrop)
mapping entities <-> viewmodels (using ValueInjecter)
Multi-Language User Interface
N-Tier Architecture
Security using Forms Authentication
pagination using "more results" button
Multiple UI themes (using jQuery UI themes)
Unobtrusive Client Side Validation using jQuery.Validate
Nice validation messages using just CSS
tinyMCE as wysiwyg editor
Html Agility Pack for sanitizing html

Thursday, 18 May 2017

Cannot start service from the command line or a debugger

Cannot start service from the command line or a debugger.  A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command

When you run windows service debug mode from VS, i got above error.

Solution:

OOTB code:

 static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
             ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[]
            {
                new Scheduler()
            };
            ServiceBase.Run(ServicesToRun);    

        }
    }

Change to:


 static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            //ServiceBase[] ServicesToRun;
            //ServicesToRun = new ServiceBase[]
            //{              
            //    new Scheduler()
            //};
            //ServiceBase.Run(ServicesToRun);


            var myService = new Scheduler();
            if (Environment.UserInteractive)
            {
                MtProject.Scheduler objScheduler = new Scheduler();
                objScheduler.GetData();
            }
            else
            {
                var servicesToRun = new ServiceBase[] { myService };
                ServiceBase.Run(servicesToRun);
            }

        }
    }