In our website we have created the reportengine which passes the parameters dynamicaly means whatever parameters are provided in Stored procedure is automaticaly binded to grid from where values are passed to sp as follows
.Actualy this code is written by some other developer
If Not ParameterTable Is Nothing Then
RecordCount = ParameterTable.Rows.Count
If RecordCount >= 1 Then
For Index = 0 to (RecordCount - 1)
ParameterRow = ParameterTable.Rows(Index)
Select Case ParameterRow(1)
Case "231"
RecordType = "SQlDbType.NVarChar"
Case "60"
RecordType = "SQlDbType.Money"
Case "61"
RecordType = "SQlDbType.DateTime"
Case "62"
RecordType = "SQlDbType.Int"
Case "59"
RecordType = "SQlDbType.Float"
Case "104"
RecordType = "SQlDbType.Bit"
Case Else
RecordType = "SQlDbType.Int"
End Select
myCommand.Parameters.Add(ParameterRow(0), RecordType).Value = (ParameterRow(2))
[red]When Sp is executed with link[/red]<A href="http://links.10026.com/?link=Main.aspx?ReportID=1075443551&ReportName=RptAPandARComparative&ReportDescription=RptAPandARComparative"
target="main">
I get the error that nvarchar can not be converted int
Why is is So?
Is anybody having same type of experiance
In above link I got reportid as queries
select id from sysobjects where name='RptAPandARComparative'
Swati Jain:
I get the error that nvarchar can not be converted int
Is your stored procedure parameter declared as an int or varchar?
|||I tried all datatypes still I got the same error with sp as well as code
|||Swati Jain:
I tried all datatypes still I got the same error with sp as well as code
Can you show us your input parameters for the stored procedures?
You would also have to specify the parameter value size as well to make sure there are no data type mismatch errors.
|||
alterPROCEDURE [enterprise].[RptAPandARComparative]
@.Year1Int,--nvarchar(8), I tried various datatypes
@.Year2Int--nvarchar(8)
AS
No Code is written for specifying the size of the datatype
|||
Swati Jain:
alterPROCEDURE [enterprise].[RptAPandARComparative]@.Year1Int,--nvarchar(8), I tried various datatypes
@.Year2Int--nvarchar(8)
your stored procedures are declared with INTEGER input paramters, so you have to set the type for your parameters toSqlDbType.Int for both input parameters.
You should also set the size as well, I believe int datatypes in SQL Server is 8 bytes.
No comments:
Post a Comment