forum

Home / DeveloperSection / Forums / How to set TypeName in the constructor of new SqlParameter?

How to set TypeName in the constructor of new SqlParameter?

Anonymous User 2012 20-Nov-2014

I am using the following code to set up parameters for a call to a stored procedure:

        List<SqlParameter>parameterList = new List<SqlParameter>();
        parameterList.Add(new SqlParameter("@Title", adminTest.Title));
        parameterList.Add(new SqlParameter("@Text", adminTest.Text));
        var questionsList = new SqlParameter("@Questions", questions);
        questionsList.TypeName = "dbo.QuestionList";
        parameterList.Add(questionsList);

The code snippet works but what I would like to know is if anyone found a way to set the TypeName in the new SqlParameter constructor? I tried looking at the documentation but the only thing I can find is adding the typename afterwards.


Updated on 21-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By