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

882 views Asked by At

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?

1

There are 1 answers

0
m3kh On BEST ANSWER
SET FMTONLY ON

Select * From dbo.Users

The above query retrieves table schema only.