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

  • SEARCH
  • Home
  • 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 6683659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:50:50+00:00 2026-05-26T04:50:50+00:00

I created a Windows Forms app that generates reports and it works great. It

  • 0

I created a Windows Forms app that generates reports and it works great. It binds a bunch of DataTables to a bunch of DataGridViews, exports the resulting display to a bitmap, and everyone is happy. I would like to create a service that generates these reports automagically instead of having to run each report by hand in my Forms based app. I am running into a problem where I have a DataTable with rows in it, but when I assign it to be the datasource for one of my DataGridViews, the number of rows in the DataGridView remains at zero.

Here is a snippet of relevant code where I am binding this data (yet it is not updating):

DataGridView testGrid = new DataGridView();
testGrid.BackgroundColor = Color.Yellow;

for (int i = ServerTableDay.Count - 1; i >= 0; i--)
{
testGrid.DataSource = ServerTableDay[i];
}

The test grid always has zero rows no matter which table I try to bind by using the .DataSource =

What am I missing, or is this even possible in a Windows Service?

  • 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-26T04:50:51+00:00Added an answer on May 26, 2026 at 4:50 am

    Based on your heading – No you will not be able to use a DataGridView with a Windows Service because this is a User Interface control and the Windows Service would have no UI control. That being said you might look into writing your output to a logfile if you want to keep track of it.

    As for your current winforms setup issue try –

    if (ServerTableDay.Count > 0) {
         testGrid.DataSource = ServerTableDay;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a windows installer for a windows forms app as an MSI.
I have created a Windows Forms application in .NET 2 using C# that runs
I am thinking about builing a windows forms app that create and publish new
I've created a windows forms application that would use a client server model for
I've created a windows forms control, which is hosted in a web page viewable
I created a VB.NET Windows Forms Application in Visual Studio 2008. When I run
I have a C# Windows Forms application, whose prototype was created on SQL Server
Using C++/CLI, How to display a managed control (eg. System::Windows::Forms::Panel^) on a window created
I have created two forms in my Windows Application. One Form acts as a
I have a requirement to create a simple windows forms application that allows an

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.