Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypedTableBase Constructor #30364

Closed
aiba7339 opened this issue Jul 25, 2019 · 5 comments
Closed

TypedTableBase Constructor #30364

aiba7339 opened this issue Jul 25, 2019 · 5 comments
Labels
area-System.Data backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity

Comments

@aiba7339
Copy link

I'm using Visual Studio 2017 C# and created some DataTables in a DataSet.
There are some codes generated by VS and some of them are TypedTableBase construcotrs.
They are in a DataSet.Designer.cs file and two constructors are defined.
The one is below.
They refers DataSet object in given DataTable, however, DataSet object is always null when I run my codes, so I catch a null reference exception when I try to create TypedTableBase object from DataTable object.
If I comment out their "if" sentences, it runs.
Is this VS's bug?

    internal FeaturesDataTable(global::System.Data.DataTable table) {
        this.TableName = table.TableName;
        if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
            this.CaseSensitive = table.CaseSensitive;
        }
        if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
            this.Locale = table.Locale;
        }
        if ((table.Namespace != table.DataSet.Namespace)) {
            this.Namespace = table.Namespace;
        }
        this.Prefix = table.Prefix;
        this.MinimumCapacity = table.MinimumCapacity;
    }
@aiba7339
Copy link
Author

It doesn't work correctly just commenting out "if" sentences.

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the Future milestone Feb 1, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@ajcvickers
Copy link
Contributor

@aiba7339 Please provide more details on what you mean by, "There are some codes generated by VS."

@ajcvickers ajcvickers removed the untriaged New issue has not been triaged by the area owner label Jun 23, 2020
@aiba7339
Copy link
Author

aiba7339 commented Jun 26, 2020

@ajcvickers Thank you for asking.

When I add a DataSet in my project, .xsd file is added in it, for example "DataSetTest.xsd".
Moreover, "DataSetTest.Designer.cs" file is automatically generated by VS.
It has some constructors as I defined some DataTable s in the dataset.
One of them is like I wrote above.

Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Dec 26, 2024
Copy link
Contributor

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@dotnet-policy-service dotnet-policy-service bot removed this from the Future milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Data backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity
Projects
None yet
Development

No branches or pull requests

4 participants