The Data in my DataTable is like
ID ContactName1 Designation1 ContactName2 Designation2 1 A dummy B sam
The Table structure of my Table is
ID ContactName Designation
I am passing the values in the stored procedure as:
@ContactName1 @Designation1 @ContactName2 @Designation2
I want a single insert statement to insert the records.
How can I achieve this?
Assuming your ID primary key is set on auto-increment, and your table has three fields:
As per the actual ID, if you don’t have it on auto-increment, which judging from the comment on Ivan’s response, you don’t, you could actually get it using the MAX() statement: