I assume you have a ListBox
You can create an xml string of selected item in ListBox and that xml string you can send as parameter to your stored procedure and then you can insert your data to your table
Following T-SQL code snippet can give you brief idea for achieving the same
DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc ='
<root>
<customer customerid="VINET" contactname="Paul Henriot">
<order customerid="VINET" employeeid="5" orderdate="1996-07-04T00:00:00">
<orderdetail orderid="10248" productid="11" quantity="12" />
<orderdetail orderid="10248" productid="42" quantity="10" />
</order>
</customer>
<customer customerid="LILAS" contactname="Carlos Gonzlez">
<order customerid="LILAS" employeeid="3" orderdate="1996-08-16T00:00:00">
<orderdetail orderid="10283" productid="72" quantity="3" />
</order>
</customer>
</root>'
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
DECLARE @table TABLE
(
CustomerID varchar(10)
,CustomerName varchar(20)
)
INSERT INTO @table
SELECT *
FROM OPENXML (@idoc, '/ROOT/Customer',1)
WITH (CustomerID varchar(10),
ContactName varchar(20))
SELECT * FROM @table
It is for your understanding purpose, If you need any help let me know...