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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:15:49+00:00 2026-06-16T00:15:49+00:00

I am creating a C# windows form application using Visual Studio 2010. The end

  • 0

I am creating a C# windows form application using Visual Studio 2010.
The end goal of this application is to enable easy modification of a database table hosted in windows server 2005.

The table has four fields: “StoreNumber”, “PlannedSales”, “Year”, and “WeekNumber”.

The query I would like to use to fill the data grid looks like this:
        SELECT StoreNumber, PlannedSales
            FROM PlannedSalesTable
            WHERE Year = [YearUpDownPicker].value and Weeknumber = [WeekUpDownPicker].value

(I would like the DataGrid to show data a week at time.)

The updownPickers are what I would like to use to make a year and week selection. Unfortunately everything available in the tool strip, created by adding a filtering query to the table adaptor, seems to be inadaquate or too complicated for the purporses of simply limiting the data the user would see.

(Why use a Drop Down or TextBox to pick a week to view when a NumericUpDown does all the validation for me…)

Is it possible to use a filtering expression on the datagrid view based on the values of a control?
How would I do it, and what would be the best way to then update the database using those same controls as inputs for YEAR and MONTH.

Thanks for the Help.

  • 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-16T00:15:49+00:00Added an answer on June 16, 2026 at 12:15 am

    Figured it out!
    I used:

    BindingSource.Filter = string.Format(“WeekNumber='{0}’ and Year='{1}'”, week, year);
    TableAdapter.Fill(DataSet);

    (Variables week and year were defined using the number pickers beforehand.)

    The statement above was called during an on-click event, and it automatically refreshed the table. Make sure the table adaptor’s ‘clear before fill’ property is set to ‘true’

    Still need to figure out how to update it this way. But for now it is displaying.

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

Sidebar

Related Questions

I am creating Windows Application Form using Visual Studio 2010. For now, I am
Im creating a c# application using visual studio 2010 on a windows 7 machine.
I am working on creating a Windows Forms Application in C++ using Visual Studio
I am working on a Windows Form-Based application in Visual Studio 2008 using C#
I'm using WPF for creating my application, I am calling a windows form using
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I'm creating a Windows Form application using C#. The form contains a ListView. It's
I'm creating a Windows Application with several forms in Microsoft Visual Studio 2005. I
Creating My Windows Form Application and using ADO.Net as Data Access layer and SQL
I am creating a Windows form application. I am using Devexpress 11.1. Is it

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.