none
Adding schema without having to fill data into dataset RRS feed

  • Question

  • Basically what I need is to add a new row to an existing database-table. In order to get the schema I now create a Datatable and use NewRow(), but that means I have to query data instead of only the schema that im interested in.

    Any way to avoid having to make a select cmd and just get the schema from the db?
    Monday, June 8, 2009 8:07 AM

Answers

  • > Any way to avoid having to make a select cmd and just get the schema from the db?

    1.  You could use strongly-typed DataSets through the Visual Studio DataSet designer.  Then you would have the schema up front.

    - or -

    2.  You could add the proper DataColumn objects to the DataSet yourself.

    Otherwise, issue your SELECT with an "impossible to match" where clause such as WHERE 0=1.  This will give back the schema without the rows.
    Monday, June 8, 2009 10:38 PM

All replies