know if a datatable is being schemafilles but not ever filles

  • Thread starter Thread starter Andrea Caldarone
  • Start date Start date
A

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?
 
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)
 
Andrea,

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

"missing schema etc).

Cor
 
William said:
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
 
Back
Top