应用程序使用了错误类型的值在传统的ASP当前操作 [英] Application uses a value of the wrong type for the current operation in classic asp
问题描述
我用下面的code调用一个存储的过程:
I am calling one stored procedure using the following code:
m_objCmd.CommandText = "StoredProc_Name"
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserID", 3, 1, 0, UserID)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserTypeID", 3, 1, 0, UserTypeID)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@AccessToken", 202, 1, 100, AccessToken)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@TokenExpiration", 135, 1, 0, TokenExpiration)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@RefreshToken", 202, 1, 100, RefreshToken)
rsUserData.Open m_objCmd, , adOpenStatic, adLockReadOnly
在上面:
-
@UserID
是一个'廉政'的dataType -
@UserTypeID
是'诠释' -
@AccessToken
类型为nvarchar(100) -
@TokenExpiration
是DATATIME(2) -
@RefreshToken
类型为nvarchar(100)
@UserID
is a 'int' dataType@UserTypeID
is 'int'@AccessToken
is nVarchar(100)@TokenExpiration
is datatime(2)@RefreshToken
is nVarchar(100)
但在这里我得到了错误:
But here I am getting the error:
应用程序使用了错误类型为当前操作的值。
Application uses a value of the wrong type for the current operation.
任何一个可以帮我请。
推荐答案
我只是前几天有这个同样的问题。我的问题是溢流库尔 - Tigin以下建议。
I had this same problem just a few days ago. My problem was overflow as Kul-Tigin suggests below.
我试图插入一个巨大的字符串长度为17,000个字符,我收到完全相同的错误,你。然后,我选择了保存在字符串中的一个文本文件,我使用的表作为一个文件定位器,以便对说话。
I was trying to insert a huge string 17,000+ characters in length and I received exactly the same error as you. I then opted to save the string in a text file and I used the table as a file locator so-to-speak.
检查值的长度以下内容:
Check the length of the values in the following:
- @UserID是一个'廉政'的dataType
- @UserTypeID是'诠释'
- @AccessToken类型为nvarchar(100)
- @TokenExpiration是DATATIME(2)
- @RefreshToken类型为nvarchar(100)
这篇关于应用程序使用了错误类型的值在传统的ASP当前操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!