Set the select, update, delete, and insert commands of sqldatasource to stored procedure, and set the output parameter in the called stored procedure. ProgramIn the corresponding selected, updated, deleted, and inserted events, use the sqldatasourcestatuseventargs e parameter in the following way:
Yourtextbox. Text = E. Command. Parameters ["@ output parameter name"]. value. tostring ();
To obtain the returned values of stored procedure from the database. Note the following points:
1. If the parameter type is set to InputOutput and output, the returned values of stored procedures can be obtained.
2. Be sure to set the parameter size. The default value of 0 will cause running errors.
In the above scenario, it seems that there is no difference in calling stored procedure in the database through select, update, delete, and insert. The four methods seem to be the same in calling the stored procedure, only serves to provide a call interface. The four names select, update, delete, and insert have no literal meaning when calling the stored procedure.
After careful attempts, the delete interface does not seem to support the above statement, but the other three can. The stored procedure I use only contains a simple SELECT command.