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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:50:45+00:00 2026-05-30T14:50:45+00:00

I’m scratching my head here… I have a large program which I’ve written in

  • 0

I’m scratching my head here… I have a large program which I’ve written in C# and there is a small bug in it, which makes absolutely no sense to me.

Very quick background:

I have a class called CompoundSet which contains a DataSet (not System.Data.DataSet, it’s my own defined class) which is defined like this:

public class CompoundSet
{
  private DataSet dataSet;
  public  DataSet { get { return dataSet; } }

  //...
}

compountSet is a local member in my main workflow class, and I launch a data editor window like this:

DataWindow dw = new DataWindow(compoundSet.DataSet);

The constructor for the DataWindow is like this:

public DataWindow(DataSet dataSet)
{
  // ...

  this.dataSet = dataSet;
}

and the DataWindow lists the contents of the DataSet in various GUI controls.

That window shows what’s currently in the DataSet. The user can modify the data as they wish. When they close dw, the changes to the data SHOULD be in the CompoundSet since we’re only passing pointers. The DataSet in compoundSet and the DataSet in dw SHOULD be the same however it isn’t.

If I set a breakpoint in the DataWindow class in the close event, I can see that the local dw.dataSet and the WorkFlow.compoundSet.DataSet do not have the same information.

Given that I have passed a pointer to compoundSet.DataSet to the DataWindow class in the constructor, and I have nowhere used a new keyword in DataWindow, this doesn’t make any sense to me?

Why is my compoundSet.DataSet different to my dw.dataSet?

Edit: I have tried creating a DataWindow like this:

DataSet ds = compoundSet.DataSet;
DataWindow dw = new DataWindow(ds);
dw.ShowDialog(this); // breakpoint on dw.FormClosing shows the dataset has new data
return; // breakpoint here shows ds is different from dw.dataSet
  • 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-30T14:50:46+00:00Added an answer on May 30, 2026 at 2:50 pm

    Your tags are a little off (because your terminology is a little bit off) but your understanding of the concepts is correct. The code you have posted is not the source of the problem.

    Specifically: you are not passing by reference, you are passing a reference type. Because it’s a reference type, you’re not passing the object itself, but a reference to the object (not a “pointer” — yes, the reference is implemented as a pointer, but that’s an implementation detail, and the word “pointer” has a specific, different meaning in c#). Because you haven’t used the “ref” keyword, you’re passing that reference by value (but this may not be relevant to your problem).

    I would guess that there’s some binding problem causing the changes in the ui not to be transmitted to the dataSet object. But according to the code you’ve posted, the DataWindow and the CompoundSet should indeed be working with the same object.

    It’s also possible that you’re reassigning the dataSet variable in the elided code, and expecting that reassignment to apply to the compoundSet.DataSet property, but your question implies that this is not the case.

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.