Home All Groups Group Topic Archive Search About

know if a datatable is being schemafilles but not ever filles

Author
12 Jan 2007 2:41 PM
Andrea Caldarone
Hi all,

in my program I initialize a lot of datatable (member of the same dataset)
with the .FillSchema method of the adapter at the startup. After when a user
trough the guy requests a such data, I populate the datatable with the .Fill
method.
If I have a such datatable (I'me sure it have been schemafilled) can I know
if that table is have been filles with .Fill method? If the table has 0 rows
is it because the sql table has 0 rows or because it hasn't been filled?

Author
12 Jan 2007 6:03 PM
William (Bill) Vaughn
Perhaps you can add a row that has known place-holder values post
SchemaFill. Before Fill, clear the table and test for the place-holder to
see if "real" data was loaded. Why pre-populate with schema?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Show quote
"Andrea Caldarone" <software-livqu***@3techsrl.com> wrote in message
news:Ox3aCflNHHA.4928@TK2MSFTNGP06.phx.gbl...
> Hi all,
>
> in my program I initialize a lot of datatable (member of the same dataset)
> with the .FillSchema method of the adapter at the startup. After when a
> user trough the guy requests a such data, I populate the datatable with
> the .Fill method.
> If I have a such datatable (I'me sure it have been schemafilled) can I
> know if that table is have been filles with .Fill method? If the table has
> 0 rows is it because the sql table has 0 rows or because it hasn't been
> filled?
>
Author
15 Jan 2007 8:18 AM
Andrea Caldarone
William (Bill) Vaughn wrote:
> Perhaps you can add a row that has known place-holder values post
> SchemaFill. Before Fill, clear the table and test for the
> place-holder to see if "real" data was loaded. Why pre-populate with
> schema?

I load the database's schema into my dataset this task requires few time,
after that I can create (I automatically do this with a class of my own) all
the foreign key relationship, customize the datatables and pass them to the
controls of my application.
When I really know that some data have to be shown to the end user, I
populate the datatables involved with the fill command.
But before invoke the .Fill method it is useful to konw if the datatable has
ever been filled:

datatable with 0 record -> is it an empty one or it has never been filled?

datatable with more than 1 records -> sure, it has just been filled, no
other .Fill is required


Show quote
>
>
> "Andrea Caldarone" <software-livqu***@3techsrl.com> wrote in message
> news:Ox3aCflNHHA.4928@TK2MSFTNGP06.phx.gbl...
>> Hi all,
>>
>> in my program I initialize a lot of datatable (member of the same
>> dataset) with the .FillSchema method of the adapter at the startup.
>> After when a user trough the guy requests a such data, I populate
>> the datatable with the .Fill method.
>> If I have a such datatable (I'me sure it have been schemafilled) can
>> I know if that table is have been filles with .Fill method? If the
>> table has 0 rows is it because the sql table has 0 rows or because
>> it hasn't been filled?
Author
13 Jan 2007 2:03 PM
Cor Ligthert [MVP]
Andrea,

The fill does filling the schema as well. Not complete but for that is as
well an command.

"missing schema etc).

Cor
Show quote
"Andrea Caldarone" <software-livqu***@3techsrl.com> schreef in bericht
news:Ox3aCflNHHA.4928@TK2MSFTNGP06.phx.gbl...
> Hi all,
>
> in my program I initialize a lot of datatable (member of the same dataset)
> with the .FillSchema method of the adapter at the startup. After when a
> user trough the guy requests a such data, I populate the datatable with
> the .Fill method.
> If I have a such datatable (I'me sure it have been schemafilled) can I
> know if that table is have been filles with .Fill method? If the table has
> 0 rows is it because the sql table has 0 rows or because it hasn't been
> filled?
>

AddThis Social Bookmark Button