>>> Hello tshad,
>>>
[quoted text clipped - 6 lines]
>>
>> Only the column names are not getting cleared.
Also, after the ds.Clear(), even though there is no table data (rows[0][0]
will give a System.IndexOutOfRangeException), ds.Tables.Count still shows as
1. So certain things are cleared from the ds as well as certain table
information, but not all of it.
I found that I can do:
ds.Tables.Clear()
And that seems to clear everything. I say "SEEMS TO" because I am not sure
if there are other things that don't get cleared but haven't run into them
yet.
It may be that you need to issue both.
I would like to see what each does clear just to make sure, but I can't seem
to find anything about it.
Thanks,
Tom
> I found out how to make it work, I just don't know why I would have to do
> this:
[quoted text clipped - 86 lines]
>>> t> t> Tom
>>> t>
Hello tshad,
Actually in should call the .clear for all tables inside the data set.
if u take reflector you found the code, which iterate all table collection
and call clear for tables
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
t> "tshad" <tfs@dslextreme.com> wrote in message
t> news:OXe9LtYbIHA.4712@TK2MSFTNGP04.phx.gbl...
t>
>>> Hello tshad,
>>>
[quoted text clipped - 6 lines]
>>
>> Only the column names are not getting cleared.
t> I found out how to make it work, I just don't know why I would have
t> to do this:
t>
t> If I add ds.tables.clear() after ds.clear(), this will clear the
t> column names as well.
t>
t> This doesn't make sense to me as I would have thought that ds.clear
t> (which gets rid of the tables) would also get rid of the columns
t> names for the tables which now don't exist.
t>
t> Thanks,
t>
t> Tom
t>
>> If I trace it through, before my da.Fill() I get:
>> ds.Tables[0].Rows[0][0] 'ds.Tables[0]' threw an exception of
[quoted text clipped - 80 lines]
>>> t> t> Tom
>>> t>
tshad - 13 Feb 2008 02:07 GMT
> Hello tshad,
>
> Actually in should call the .clear for all tables inside the data set.
> if u take reflector you found the code, which iterate all table collection
> and call clear for tables
Not sure what you mean here.
ds.clear() does clear all the tables, just not the columnname and
ds.tables.count().
ds.Tables.Clear() appears to clear all the tables including the columnNames
and ds.tables.count().
I am just not sure if I should call both. There may be something that
ds.clear() handles that ds.tables.clear() doesn't (just like the problem
when I do the reverse).
Thanks,
Tom
> ---
> WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
[quoted text clipped - 111 lines]
>>>> t> t> Tom
>>>> t>
tshad - 24 Feb 2008 18:27 GMT
> Hello tshad,
>
> Actually in should call the .clear for all tables inside the data set.
> if u take reflector you found the code, which iterate all table collection
> and call clear for tables
Not sure what you mean by this?
Are you saying that you need to do a foreach loop and clear each table?
Thanks,
Tom
> ---
> WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
[quoted text clipped - 111 lines]
>>>> t> t> Tom
>>>> t>