Skip to main content

Posts

Amazon Recurring Payment Integration

Please click here for get Amazon recurring payment integration details
Recent posts

Get Timestamp in ISO8601 format using c#

 private String GetFormattedTimestamp()         {             DateTime dateTime = DateTime.Now;             return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day,                                  dateTime.Hour, dateTime.Minute, dateTime.Second,                                  dateTime.Millisecond                                 , DateTimeKind.Local   ...
How to get database list using sql command> Below link more helpfull for get database list. https://www.simple-talk.com/sql/database-administration/exploring-your-sql-server-databases-with-t-sql/ 1. Basic Server Information -- Server and instance name Select   @@SERVERNAME   as   [Server\Instance] ; -- SQL Server Version Select   @@VERSION   as   SQLServerVersion ; -- SQL Server Instance Select   @@ServiceName   AS   ServiceInstance ; -- Current Database Select   DB_NAME ()   AS   CurrentDB_Name ; -- Note the tempdb system database is recreated every time the server restarts -- Thus this is one method to tell when the database server was last restarted SELECT    @@Servername   AS   ServerName   ,          create_date   AS   ServerStarted   ,          DATEDIFF ( s , ...
How to restore database using sql command? RESTORE DATABASE Test1 FROM  DISK = N'C:\inetpub\PoologicDatabaseBakFile\PoologicDataBase.bak'   WITH REPLACE,   MOVE 'PoologicsBakFile' TO 'C:\inetpub\PoologicDatabaseBakFile\Test1.mdf',   MOVE 'PoologicsBakFile_log' TO 'C:\inetpub\PoologicDatabaseBakFile\Test1.ldf';
How to download partial view content using c#? private static string CallApplicationControllerForSnapshotHtml(Guid subscriberId, int duration, long? subscriberUserId, string conString)         {             string myUrl = string.Format(ServiceConfigurationHelper.GetAppSettingValue("GetHtmlContentUrl") + "?subscriberId={0}&duration={1}&SubscriberUserId={2}&conString={3}", subscriberId, duration, subscriberUserId, conString);             WebClient wc = new WebClient();             string requestResult = wc.DownloadString(myUrl);             return requestResult;         }
How to make time format in AM PM in c#? Add below code in function.  static DateTimeFormatInfo timeFormat = new DateTimeFormatInfo();  timeFormat.ShortTimePattern = CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern;  timeFormat.AMDesignator = "AM";  timeFormat.PMDesignator = "PM";         public static string GetCurrentTime         {             get             {                 return String.Format(timeFormat, "{0:t}", DateTime.UtcNow).Replace(" ", "");             }         }
How to create window service using timer?  Timer timerDailyReport = new Timer();  protected override void OnStart(string[] args)         {             try             {                               StartTimer(timerDailyReport, 60000, timerDailyReport_Elapsed);                           }             catch (Exception ex)             {                 ErrorLog.WriteonError("OnStart " + ex.Message.ToString());             }         } private void StartTimer(Timer timer, long interval, ElapsedEventHandler events)         {             timer.Int...