I create a Sql Type...
CREATE TYPE dbo.ScoreType AS TABLE ( ScoreID int, etc.... )
pass datatable from C# code into the stored procedure using the above defined type
ALTER proc [dbo].[InsertIntoScore]
( @DateReg datetime, @stdLastName nvarchar(50), @stdFirstName nvarchar(50),
@Description nvarchar(500), @tvpScore ScoreType)
AS
.....
INSERT INTO dbo.Score (ScoreID, ....)
SELECT dt.ScoreID, dt..... FROM @tvpScore AS dt;
But I can not use the ScoreType in @tvpScore ScoreType. please help me...
Error:
The table-valued parameter "@tvpScore " must be declared with the READONLY option.