Error when inserting data into sqlserver: the input table format data stream (TDS) Remote Procedure Call (RPC) protocol stream is incorrect

Source: Internet
Author: User
Today, we are working on a news publishing system that requires support for three languages: Chinese, Japanese, and English.
There is a field in the News table: content text type

There is no problem in other aspects, that is, when the news length exceeds a certain length during insertion or modification of Japanese news, an error is reported:
[System. Data. sqlclient. sqlexception] = {"the input table format data stream (TDS) Remote Process Call (RPC) protocol stream is incorrect. Parameter 5 ("" @ content ""): The Data Length of the Data Type 0xa7 or the metadata length is invalid. "}

I have finally solved the problem through online data query and my own experiments -_-
Original code:
Sqlparams. Add (New sqlparameter ("@ content", sqldbtype. varchar ));
Modified code:
 Sqlparams. Add (New sqlparameter ("@ content", sqldbtype. varchar,-1 ));
That is, the size value corresponding to the specified text type is-1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.