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.