CREATE PROCEDURE [dbo].[GetNameById] @studentid varchar(8), @studentname nvarchar(50) OUTPUT AS BEGIN SELECT @studentname=studentname FROM student WHERE studentid=@studentid if @@Error<>0 RETURN -1 else RETURN 0 END using (SqlConnection conn = new S…
CREATE PROCEDURE [dbo].[GetNameById] @studentid varchar(), @studentname nvarchar() OUTPUT AS BEGIN SELECT @studentname=studentname FROM student WHERE studentid=@studentid RETURN - else RETURN END using (SqlConnection conn = new SqlConnection(connStr)…
玛德,数据行都返回过来了,就是没有输出参数!!! 扒官方设计文档:这么一段 雷死人了!!! When a stored procedure is called using MySqlCommand.ExecuteReader, and the stored procedure has output parameters, the output parameters are only set after the MySqlDataReader returned by ExecuteReader i…