In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to solve the exception caused by the long update string of the subsonic3.0 plug-in". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the exception caused by the long update string of the subsonic3.0 plug-in".
Open the project solution, enter DEBUG mode, get the operational data and submit it for tracking, and find that the submission generated: System.Data.SqlClient.SqlException (0x80131904): the incoming tabular data flow (TDS) remote procedure call (RPC) protocol flow is incorrect. Parameter 4 ("@ up_xxx"): the data length or metadata length of the data type 0xA7 is invalid.
Baidu found that the exception was caused by an overlong update string, so the Size of the parameter must be set to-1, so it is handled according to the following figure.
The copy code is as follows:
Private static void AddParams (DbCommand cmd, QueryCommand qry)
{
If (qry.Parameters! = null)
{
Foreach (QueryParameter param in qry.Parameters)
{
DbParameter p = cmd.CreateParameter ()
P.ParameterName = param.ParameterName
P.Direction = param.Mode
P.DbType = param.DataType
/ *
* revised by: Empty (AllEmpty)
* Modification instructions: modify the Bug caused by the long length of the submitted string
* exception message: System.Data.SqlClient.SqlException (0x80131904): the incoming tabular data flow (TDS) remote procedure call (RPC) protocol stream is incorrect.
* Parameter 4 ("@ up_xxx"): invalid data length or metadata length for data type 0xA7.
* /
If (param.DataType.ToString () = = "AnsiString")
{
P.Size =-1
}
/ / output parameters need to define a size
/ / our default is 50
If (p.Direction = = ParameterDirection.Output | | p.Direction = = ParameterDirection.InputOutput)
P.Size = param.Size
/ / fix for NULLs as parameter values
If (param.ParameterValue = = null)
{
P.Value = DBNull.Value
}
Else if (param.DataType = = DbType.Guid)
{
String paramValue = param.ParameterValue.ToString ()
If (! String.IsNullOrEmpty (paramValue))
{
If (! paramValue.Equals ("DEFAULT", StringComparison.InvariantCultureIgnoreCase))
P.Value = new Guid (paramValue)
}
Else
P.Value = DBNull.Value
}
Else
P.Value = param.ParameterValue
Cmd.Parameters.Add (p)
}
}
}
Thank you for reading, the above is the content of "how to solve the exception caused by the subsonic3.0 plug-in update string is too long". After the study of this article, I believe you have a deeper understanding of how to solve the problem of the exception caused by the subsonic3.0 plug-in update string is too long, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.