Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7856273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:39:10+00:00 2026-06-02T20:39:10+00:00

I have a windows service. It connects and checks my database every 18seconds before

  • 0

I have a windows service. It connects and checks my database every 18seconds before sending out a soap message to an external client.
I have successfully installed the service on my computer but it is not doing anything in particular nor is it filling my server logs with any errors.

How do I find out where I went wrong?

Updated

protected override void OnStart(string[] args)
    {
        timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
        timer.Interval = 15000;
        timer.Enabled = true;
        timer.Start();
        eventLog1.WriteEntry("Windows Service 3 Started");
    }

    protected override void OnStop()
    {
        eventLog1.WriteEntry("Windows Service 3 Stopped");

    }

My RunAPP() is where I have connected to the database via a stored procedure.

Any insight into my problem would be great!

  private void RunApp()
    {

        p.Start();
        string connStr = ConfigurationManager.ConnectionStrings["bbsConnectionString"].ConnectionString;
        try
        {
            SqlConnection Con = new SqlConnection(connStr);
            Con.Open();
            SqlCommand cmd = new SqlCommand("AvailableChanges", Con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlParameter NewSysChangeVersionParam = new SqlParameter("@NewSysChangeVersion", SqlDbType.Int);
            NewSysChangeVersion.Value = (object)NewSysChangeVersion ?? DBNull.Value;
            NewSysChangeVersion.Direction = ParameterDirection.InputOutput;
            NewSysChangeVersion.SqlDbType = SqlDbType.BigInt;
            SqlDataReader sdr = cmd.ExecuteReader();
            int sdrreader = sdr.FieldCount;
            InventoryPushSubscriptionRecord rec = new InventoryPushSubscriptionRecord();


            while (sdr.Read())
            {

                inrec.InventoryPushSubscriptionId = sdr.GetInt32(0);
                inrec.SysChangeVersion = sdr.IsDBNull(1) ? (long?)null : sdr.GetInt64(1);
                inrec.InvDate = sdr.GetDateTime(2);
                inrec.ResortId = sdr.GetInt32(3);
                inrec.RoomType = sdr.GetString(4);
                inrec.InvCount = sdr.GetInt32(5);
                inrec.ResortName = sdr.GetString(6);


                Int64 NewSysChangeVersion;
                NewSysChangeVersion = Convert.ToInt64(rec.LastSysChangeVersion);
                int ResortId;
                ResortId = inrec.ResortId;
                string RoomType;
                RoomType = inrec.RoomType;
                int avail = inrec.InvCount;
                DateTime frodte = inrec.InvDate;
                DateTime todte = inrec.InvDate;
                int NoofRatePackages = sdrreader;
                Int32 InventoryPushSubscriptionId;
                InventoryPushSubscriptionId = inrec.InventoryPushSubscriptionId;
                Int64 NewLastSysChangeVersion;
                NewLastSysChangeVersion = Convert.ToInt64(inrec.SysChangeVersion);
                if (NewSysChangeVersion != null)
                {
                    sendUpdate(NewSysChangeVersion, ResortId, RoomType, avail, frodte, todte, NoofRatePackages, InventoryPushSubscriptionId, NewLastSysChangeVersion);
                }
            }

            //    sdr.Close();
            //    sdr.Dispose();

        }

        catch (Exception ex)
        {

Updated
eventLog1.WriteEntry(“exception”);
throw;
}
}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:39:12+00:00Added an answer on June 2, 2026 at 8:39 pm

    Editted my exception as advised.

    catch (Exception ex)
    {

                eventLog1.WriteEntry(ex.Message);
                eventLog1.WriteEntry(ex.StackTrace);
                throw;
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing windows service that connects to the database and do updates
enter code here Hi All, I have a simple windows service application that connects
i have a windows service that runs every 10 seconds to execute the read
Lets suppose I have an .NET client application that connects to a WCF service,
We currently have an application (Windows service) that connects to another of our applications
I have a Windows Service which is basically accessing a mailbox and reading the
I have a windows service and use nlog for logging. Everything works fine when
I have a Windows Service running on a .Net 2.0 environment (NOT UPGRADABLE TO
I have a windows service, written in c# and I need to run a
I have a Windows service that runs as a logged-in user (local admin). During

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.