Search Chirayu Software Solutions Blog

Wednesday, December 11, 2013

route command in windows

1) To List all the routes in your PC.

route print

2) To Add a route

route add -p 172.16.0.0 mask 255.255.0.0 10.25.4.1

172.16.0.0 is the destination network.
10.25.4.1 is your gateway.

3) To Delete an old route.

route delete 172.16.0.0


Tuesday, December 3, 2013

Write to Event Log in Windows PC using C# .Net

using System;
using System.Diagnostics;

namespace WriteToAnEventLog_csharp
{
 /// Summary description for Class1.
 class Class1
 {
  static void Main(string[] args)
  {
   string sSource;
   string sLog;
   string sEvent;

   sSource = "dotNET Sample App";
   sLog = "Application";
   sEvent = "Sample Event";

   if (!EventLog.SourceExists(sSource))
    EventLog.CreateEventSource(sSource,sLog);

   EventLog.WriteEntry(sSource,sEvent);
   EventLog.WriteEntry(sSource, sEvent,
    EventLogEntryType.Warning, 234);
  }
 }
}

Get Month Name from Date in Sql Query

select datename(month, S0.OrderDateTime)