Home All Groups Group Topic Archive Search About

Getting an emty dataset

Author
21 Aug 2006 2:21 AM
David A. Osborn
What is the best way to get an empty datatable (or data row) that is
formatted like a row in my sql table, I assume that doing a select * from
table where 1 = 0 is not a very efficient way to do it?  Do I some how
define the table structure as an object which would needs to be updated if a
column was added to the database?  What I need to be able to do is reference
the columns in my datarow, by the name that they are called in the database.
Thanks

Author
21 Aug 2006 2:58 AM
Kerry Moorman
David,

You can use the dataadapter's FillSchema method.

Kerry Moorman


Show quoteHide quote
"David A. Osborn" wrote:

> What is the best way to get an empty datatable (or data row) that is
> formatted like a row in my sql table, I assume that doing a select * from
> table where 1 = 0 is not a very efficient way to do it?  Do I some how
> define the table structure as an object which would needs to be updated if a
> column was added to the database?  What I need to be able to do is reference
> the columns in my datarow, by the name that they are called in the database.
> Thanks
>
>
>