From msdn website I get the following:
A special data type for specifying structured data contained in table-valued parameters.
It seems my code works with it and without it (pushing table to DB using stored procedure).
Can someone explain what does it do - I didn't understand it from the definition.
A special data type for specifying structured data contained in table-valued parameters.
SqlDbType = dataType ; Specifies the SQL Server data type of the parameter, using the SqlDbType enumeration in the System. Data namespace. If this property is set, the value of the Parameter is converted to this type before it's passed to the data source. The default is a SqlDbType.
Specifies SQL Server-specific data type of a field, property, for use in a System.
Table-valued parameters are declared by using user-defined table types. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.
In SQL Server, you can define stored procedures and you can pass tables as parameter. This is then called a table valued parameter.
When you are programming in C#, you can pass such a table-valued parameter to the database by using the SqlDbType.Structured
constant.
This post shows an example: How to pass a table-value parameter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With