My original post asked the question: what happens when you declare a
datatable with the same name in Class1 as you used in Class2? As Miha
pointed out, "DataSet won't be gc-ed until you drop all references to it ..
while you have at least one living reference DataSet instance will be
there." And Kevin Yu answered that, "If you still hold some reference to the
object, you have to fill the DataTable with other names, because the
original table is still in it." Excellent advice and duly noted.

Here's the issue however. I fill the DS with a dtSupply table in lets say
Class1. I clear this table out of the DataSet in Class2 before filling the
DataSet with a table with the the same dtSupply name as I used in Class1.
The schema for these two tables differs ... but the schema for the Class1
table stays in the DataSet ALSO! So while I can populate a table in Class2
with different data for the same table, the table SCHEMA itself remains in
the DataSet despite being cleared from the DataSet. From a practical
standpoint, this is a non-issue with what I am currently working on, as it
is easy enough to simply use a different name for the tables. But I am
curious if there is a "schema-clear" method for the datatables within the
dataset?

Re: Revisiting the issue of "Filling the dataset with a table with same name as in another class" by chen

chen
Mon Jul 05 22:29:12 CDT 2004

can DataSet.Tables.Remove(string tb) solve this issue?

"Earl" <brikshoe@newsgroups.nospam> wrote in message
news:egvaqGuYEHA.3128@TK2MSFTNGP09.phx.gbl...
> My original post asked the question: what happens when you declare a
> datatable with the same name in Class1 as you used in Class2? As Miha
> pointed out, "DataSet won't be gc-ed until you drop all references to it
..
> while you have at least one living reference DataSet instance will be
> there." And Kevin Yu answered that, "If you still hold some reference to
the
> object, you have to fill the DataTable with other names, because the
> original table is still in it." Excellent advice and duly noted.
>
> Here's the issue however. I fill the DS with a dtSupply table in lets say
> Class1. I clear this table out of the DataSet in Class2 before filling the
> DataSet with a table with the the same dtSupply name as I used in Class1.
> The schema for these two tables differs ... but the schema for the Class1
> table stays in the DataSet ALSO! So while I can populate a table in Class2
> with different data for the same table, the table SCHEMA itself remains in
> the DataSet despite being cleared from the DataSet. From a practical
> standpoint, this is a non-issue with what I am currently working on, as it
> is easy enough to simply use a different name for the tables. But I am
> curious if there is a "schema-clear" method for the datatables within the
> dataset?
>
>


Re: Revisiting the issue of "Filling the dataset with a table with same name as in another class" by v-kevy

v-kevy
Tue Jul 06 01:27:52 CDT 2004

Hi Earl,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that after you have cleared the table, the
schema for the table still remains in the DataSet. If there is any
misunderstanding, please feel free to let me know.

Could you let us know how you cleared the data in the table? Did you use
DataTable.Clear method? As far as I know, the Clear method will not remove
the schema for you but clear data in the table only. So if you need to
remove everything in the table please try to use
DataSet.Tables.Remove("dtSupply") as chen qi recommended.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Revisiting the issue of "Filling the dataset with a table with same name as in another class" by Earl

Earl
Tue Jul 06 11:28:48 CDT 2004

Thanks to both Chen and Kevin. That is the solution.

"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:PwoIhJyYEHA.1580@cpmsftngxa06.phx.gbl...
> Hi Earl,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that after you have cleared the table, the
> schema for the table still remains in the DataSet. If there is any
> misunderstanding, please feel free to let me know.
>
> Could you let us know how you cleared the data in the table? Did you use
> DataTable.Clear method? As far as I know, the Clear method will not remove
> the schema for you but clear data in the table only. So if you need to
> remove everything in the table please try to use
> DataSet.Tables.Remove("dtSupply") as chen qi recommended.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>