SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[TEST]
// Table1
@col1 NVARCHAR(MAX),
@col2 NVARCHAR(MAX),
@col3 NVARCHAR(MAX),
@col4 NVARCHAR(MAX),
// Table 2
@FileName NVARCHAR(50),
@FilePath NVARCHAR(200),
// Table 3
@col4 NVARCHAR(MAX)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Table_Var TABLE (ID1 INT)
INSERT INTO Table1 (col1,col2,col3,col4,COL5)
OUTPUT inserted.ID1
INTO @Table_Var(ID1)
SELECT @col1,@col2,@col3,@col4, @COL5
INSERT INTO Table2 (colID,FileName,FilePath)
SELECT ID1,@FileName,@FilePath
FROM @Table_Var
END
This is part of code that is inserting text value from Table 3, through Listbox and Label.
foreach (ListItem item in Table3.Items)
{
if (item.Selected)
{
try
{
Label1.Text = item.Text + ", " + Label1.Text;
cmd.Parameters["@COL5"].Value = Label1.Text;
}
catch (Exception ex)
{
}
}
}