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 6339987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:45:11+00:00 2026-05-24T19:45:11+00:00

This is my first post here, but I’ve using this site regularly to help

  • 0

This is my first post here, but I’ve using this site regularly to help me with my own app’s, and I should say that this site has been a great help to me, so thanks to everyone.

Now my question:
I’m developing my first software app that exchanges data between a sql server and the app itself. It’s beeing developed in C#. Saving or retreiving data from the sql server database is no problem.
What I want is a way to inform the user of the delay between the local machine (where the app is installed) and the server. I can make some animations or simply display some text messages. What I need help with is how to create the code that activates/fires/runs when that server communication time is running.

If you can’t understand the idea, picture a video game. When it’s loading (in some games) you can see the loading screen before the game starts. I need some code that displays that “loading window” when the the app is downloading or uploading data from/to the server.

I would appreciate any code example or web site recommendation.

PS: Sorry for the extensive text, but I want to make sure everyone understand so I don’t have to repeat it again 😛

  • 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-05-24T19:45:11+00:00Added an answer on May 24, 2026 at 7:45 pm

    First let me thank you for your replies.

    Toby your answer got me thinking about thread monitoring my sql connections but it was a bit tricky and confusing since the app is still in develop and will use a lot more connections.

    S.Amani answer it wasn’t quite what I want, but thanks to that I found a easier way. I created a form (could be anything else), placed a label saying: Saving To Data Base, took out the top bar, defined location and defined it’s parent to be disabled when shown and enabled when closed. The following code is what I put inside my DataBaseInteractionClass

    private Wait myCustomWaitDialog = new Wait(); // My Waiting form
    
    private void SaveToDatabase(myObjectToSave obj) // Method called to save data do DB
    {
        // Create the connections and queries
        (...)
        // This is what I did
        // Show Waiting Form
        myCustomWaitDialog.Show();
        // Instanciate the command that will carry the query and to DB
        SqlCommand command = new SqlCommand(Queries.GetData(code), conn);
        // This is important
        //Create event that will fire when the command completes
        command.StatementCompleted += new StatementCompletedEventHandler(command_StatementCompleted);
        // Execute the transaction
        SqlDataReader reader = command.ExecuteReader();
        // Rest of the code (validations, close connections, try/catch, etc
        (...)
    }
    
    void command_StatementCompleted(object sender, StatementCompletedEventArgs e)
    {
        // This is the method that closes my Waiting Dialog 
        myCustomWaitDialog.CloseDialog();
        myCustomWaitDialog.Dispose();
    }
    

    It’s not quite what I want yet, but is the best solution that I found so far. For now it will do 🙂
    Anyway, thanks for the replies and I hope this helps someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first post here. I'm using an existing Flash widget but would
Well, this is my first post here and really enjoying the site. I have
First post here: -Deep Breath- In order to 'windowise' an app that works pretty
Usless Background Info Hello, all. This is my first post here, but I often
Sorry folks...first post here. Just getting the hang of this site. Thanks for the
this is my first post here but I've been a frequent reader of various
this is my first post on here, though with the help of many questions
This is my first post here and I wanted to get some input from
this is my first post here on stackoverflow and am very impressed by the
this is my first post here! I'm trying to make a windows forms program

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.