You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database.
You need to ensure that the application calls a stored procedure that accepts a table-valued parameter.
You create a SqlParameter object. What should you do next?
A.
Set the SqlDbType of SqlParameter to Udt.
B.
Set the SqlDbType of SqlParameter to Variant.
C.
Set the ParameterDirection of SqlParameter to Output.
D.
Set the SqlDbType of SqlParameter to Structured. Set the TypeName of SqlParameter to Udt.
Explanation:
SqlParameter.DbType Gets or sets the SqlDbType of the parameter.
SqlParameter.TypeName Gets or sets the type name for a table-valued parameter.SqlDbType.Structured A special data type for specifying structured data contained in table-valued parameters.
Udt A SQL Server 2005 user-defined type (UDT).Spatial types
(http://msdn.microsoft.com/en-us/library/ff848797.aspx)Types of Spatial Data
(http://msdn.microsoft.com/en-us/library/bb964711.aspx)
SqlDbType Enumeration: http://msdn.microsoft.com/en-us/library/system.data.sqldbtype(v=vs.100).aspx
The answer is kind of misleading. Yes, you need to set SqlParameter to Structured, and yes you need to set TypeName to some string, but not Udt. I’m guessing it was copied wrong.