ado.netnewrow

How to get schema of our table without filling its DataTable before calling NewRow method?


I know that I should have schema of a table before calling NewRow method in order to add a new row to a DataTable....

But as you know, having the schema of a table means filling its DataTable by records from DB. This means connecting to DB and fetch records.

Is there any way to have schema without performing a select statement?


Solution

  • SET FMTONLY ON
    
    Select * From dbo.Users
    

    The above query retrieves table schema only.