I have a data table created in C #.
DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Age", typeof(int)); dt.Rows.Add("James", 23); dt.Rows.Add("Smith", 40); dt.Rows.Add("Paul", 20);
I want to pass this to the next stored procedure.
CREATE PROCEDURE SomeName(@data DATATABLE) AS BEGIN INSERT INTO SOMETABLE(Column2,Column3) VALUES(......); END
My question is: how do we insert these 3 tuples into an SQL table? do we need to access column values ββusing the dot operator? or is there any other way to do this?
source share