This topic has not yet been rated Rate this topic

SqlParameter.TypeName Property

Gets or sets the type name for a table-valued parameter.

Namespace:  System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)
[BrowsableAttribute(false)]
public string TypeName { get; set; }

Property Value

Type: System.String
The type name of the specified table-valued parameter.

.NET Framework

Supported in: 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(2000 characters remaining)
Community Content Add
Annotations FAQ
Table-valued parameter with types in non-dbo schemas
For table-valued parameters that use user-defined table types in specific schemas, you can reference the type by setting TypeName to [schema].[typename].

Example:

T-SQL:

CREATE SCHEMA example
GO

CREATE TYPE example.MyTableType AS TABLE (col1 int /* etc. */)

C#:

SqlParameter p = new SqlParameter();
// ... snip ...
p.TypeName = "[example].[MyTableType]";