ADO.Net Insert strongly typed string without loading dataset into memory

Is there a way to insert a row using ADO.Net without populating the dataset or specifying columns? My datasets can be large, so I don't want to load them to add a row. I know I can insert using the adapter and specify the columns, but I will need to do this for many tables, so I don't want to write my own code to handle each individual table.

+1


a source to share


1 answer


Load the table into ADO.NET DataSet using the following query:

select * from myTable where (1=0)

      



This will give you a null row dataset.

Then add a row to the dataset and ask the adapter to save it for you.

+3


a source







All Articles