How to pass ADO.NET table valued parameter and how to handle stored procedure it in SQL server 2008
I am using SQL server 2008 and C# ADO.NET to accomplish this.

    USE [MYDATABASE]
    GO
    
    CREATE TYPE [dbo].[TVP] AS TABLE(
    	[ID] [int] NOT NULL,
    	[myQuestion] [int] NOT NULL,
    	[PersonWhoResponses] [int] NOT NULL,
    	[Response] [varchar](max) NULL,
    	[User] [varchar](100) NOT NULL,
    	[DateTime] [datetime] NULL,
    	PRIMARY KEY CLUSTERED 
    (
    	[ID] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    )
    GO

My stored procedure ( Incomplete )

        CREATE PROCEDURE [dbo].[spSave] (
        @theDATA As [dbo].[TVP] Readonly
        )
        AS
        
        Begin
          -- I don't know how to insert the data into a table 
             lets say the tables name is SAVERESPONSE
          -- SAVERESPONSE has those columns already .. just insert
        End


On the C# end using ADO.NET the 

 - ID is an array from 1-5 int 
 - myQuestion is an array of 1-5 int
 - personWhoResponses is 1 int 
 - Response is 1-5 varchar 
 - User is 1 name Varchar 
 - DateTime 1 datetime

I want to use stored procedure to insert these data into table SAVERESPONSE and since sql server does not support arrays I was told this is the best method for inserting arrays.

I am quite lost as this is my first time using table valued parameter and if you have any other suggestions I would appreciate and since I am a novice please explain.

If this is not clear enough please ask I will promptly edit the question.

Thank you

Srosh

How to pass ADO.NET table valued parameter and how to handle stored procedure it in SQL server 2008
===

I am using SQL server 2008 and C# ADO.NET to accomplish this.

    USE [MYDATABASE]
    GO
    
    CREATE TYPE [dbo].[TVP] AS TABLE(
    	[ID] [int] NOT NULL,
    	[myQuestion] [int] NOT NULL,
    	[PersonWhoResponses] [int] NOT NULL,
    	[Response] [varchar](max) NULL,
    	[User] [varchar](100) NOT NULL,
    	[DateTime] [datetime] NULL,
    	PRIMARY KEY CLUSTERED 
    (
    	[ID] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    )
    GO

My stored procedure ( Incomplete )

        CREATE PROCEDURE [dbo].[spSave] (
        @theDATA As [dbo].[TVP] Readonly
        )
        AS
        
        Begin
          -- I don't know how to insert the data into a table 
             lets say the tables name is SAVERESPONSE
          -- SAVERESPONSE has those columns already .. just insert
        End


On the C# end using ADO.NET the 

 - ID is an array from 1-5 int 
 - myQuestion is an array of 1-5 int
 - personWhoResponses is 1 int 
 - Response is 1-5 varchar 
 - User is 1 name Varchar 
 - DateTime 1 datetime

I want to use stored procedure to insert these data into table SAVERESPONSE and since sql server does not support arrays I was told this is the best method for inserting arrays.

I am quite lost as this is my first time using table valued parameter and if you have any other suggestions I would appreciate and since I am a novice please explain.

If this is not clear enough please ask I will promptly edit the question.

Thank you

Srosh
