Getting an emty dataset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David A. Osborn

    #1

    Getting an emty dataset

    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


  • Kerry Moorman

    #2
    RE: Getting an emty dataset

    David,

    You can use the dataadapter's FillSchema method.

    Kerry Moorman


    "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
    >
    >
    >

    Comment

    Working...