Need to get empty datatable in .net with database table schema

前端 未结 10 852
闹比i
闹比i 2021-02-07 04:40

What is the best way to create an Empty DataTable object with the schema of a sql server table?

10条回答
  •  长发绾君心
    2021-02-07 05:12

    Try: SELECT TOP 0 * FROM [TableName]

    and use SQLDataAdapter to fill a DataSet, then get the Table from that DataSet.

提交回复
热议问题