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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:56:02+00:00 2026-05-24T08:56:02+00:00

I have a problem with C#.NET (Visual Studio 2010). I have 2 datatables in

  • 0

I have a problem with C#.NET (Visual Studio 2010). I have 2 datatables in SQL2005 express :

  1. Building which its primary key is “building number”,
  2. and Aparatment which its primary key is “building number” (foreign key to Building table) + “apartment number”. (apartment is weak entity of building and its key is composite).

Both tables are part of a greater database which I’ve imported into the project as DataSet.
I want to show the apartment details when I choose the building number and apartment number. Building number is set in an textbox (which its values are always building numbers chosen by a different control) and I want a combo-box to show only apartment numbers that the building in textbox has and not all apartment numbers in the table (which results in something like 1, 2, 3, 1, 4, 5, 1, 2, … (because it selects all the rows)). Not all the buildings share the same apartment numbers or same the same quantity of apartments which I should add/change/delete on the fly.

Choosing the building part is done and running. I just have problem with showing only the current building apartments (at least the apartment numbers I need).

I don’t want (more precisely not allowed) to use datagrid. “Detailed” controls only.

How do I do that? I have little experience with C# and I don’t know how to work “to the max” with DataSets either.
I’ve thought of maybe to create a view that will give me the results but I don’t know how to import a view and set the building number as a parameter.
Any other sane way is also welcome.

Please help.

Many thanks ahead,
Shay.

  • 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-24T08:56:03+00:00Added an answer on May 24, 2026 at 8:56 am

    I would create two dropdowns for this where their autopostback is set to true. On page load I would select all building ids and place them in its dropdown. When the dropdown is changed, an onchange event is fired which populates the 2nd dropdown with all the apartment ids for that corresponding building id.

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

Sidebar

Related Questions

im writing an application using Visual Studio 2010 Express Edition. I have a problem
I have this problem: I have a vb.net class (visual studio 2010) : ....
I have a problem where I compiled my application on Visual Studio 2010 while
I have built my new website in Visual Studio 2010 (C# - ASP.NET 4).
I have deploy my code in visual studio .NET 2010 in order to select
I have a very strange problem with my Visual Studio 2010 SP1 installation on
I have a VB.NET project in Visual Studio 2010 for an Excel Add-In. I
I am using Visual Studio 2010, C# .NET 4.0. I have 3 forms: Form1,
I have a problem with a little .Net web application which uses the Amazon
I'm trying to sign a .net assembly with Visual Studio (2010). On the properties

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.