I have a system for Visitor management , it's include 2part one for visit and other for visitor a form for visit info conatains many field enterd by textbox and dropdown list , the visitor info appear in gridview becuase its possible one visit include many visitors so i have many info for them Like (Nationality, National ID, OrgName , Name).
i need stored procedure to save all this data in DB in Visit table and to link the tow part in the same table by one button.
Name MamePosted Mar 2, 2023, 9:18 AM
@Tuhin Paul
Thanks alot for your help , its work .
Tuhin PaulPosted Feb 28, 2023, 8:53 AM
The stored procedure that you can use to save data to the Visit table and link it with the visitors:
This stored procedure takes in the visit data as parameters (@VisitDate, @VisitStartTime, @VisitEndTime, @VisitPurpose, and @VisitLocation), as well as a table-valued parameter @VisitorData that contains the visitor data. The VisitorData table type needs to be created first, like this:
To call the stored procedure, you can use something like this in your application code:
This assumes that you have a connection string stored in a variable called connectionString, and that you have variables for the visit data (visitDate, visitStartTime, visitEndTime, visitPurpose, and visitLocation) that you're passing to the stored procedure.