且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将对象列表传递到SQL Server存储过程并使用asp.net核心插入记录

更新时间:2022-11-28 18:41:42

您是在Type定义中选择的,而不是参数。尝试以下操作:

You are selecting from the Type definition, not the parameter. Try this:

CREATE PROCEDURE [dbo].[sp_InsertUser] 
    -- Add the parameters for the stored procedure here
    @UserTableType UserTableType READONLY

AS
BEGIN
    INSERT INTO tblUser
        SELECT * FROM @UserTableType
END