Click here to Skip to main content
16,016,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends ,

I m tried to insert multiple rows at a time. So, i am used DataTable to insert data. But at the runtime , i can't able to insert the records. The follwing exception was thrown. Please any one suggest to me, how to pass the table through datatable.


The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect.
Table-valued parameter 1 ("@TypeTravellerDetails"), row 0, column 0:
Data type 0xF3 (user-defined table type) has a non-zero length database name specified.
Database name is not allowed with a table-valued parameter,
only schema name and type name are valid.

Reference link : Sending a DataTable to a Stored Procedure[^]
Posted
Updated 13-Feb-20 8:47am

 
Share this answer
 
v2
Comments
Member 11307706 6-Feb-15 5:18am    
Hello peter thanks for the answer. Your code is fine for ADO.Net. But , the problem is we should be use Microsoft.Practices.EnterpriseLibrary.Data Database class or Microsoft.Practices.EnterpriseLibrary.Data objects . Is it possible ? Please give me some suggestion.
When using SqlCommandBuilder.DeriveParameters with a user defined table type input parameter stored procedure there is a bug.
SqlCommandBuilder.DeriveParameters will return the user defined table type SqlParameter.TypeName prefaced with the database name.
Example: SqlParameter.TypeName = Sandy.Data.Idar
Set SqlParameter.TypeName to the type name only and this will solve the error.
Example: SqlParameter.TypeName = Data.Idar
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900