Showing posts with label perfectly. Show all posts
Showing posts with label perfectly. Show all posts

Wednesday, March 28, 2012

I dont know how to use storedProcedure that returns one value as a result to a VB calling

My stored procedure works perfectly when I run Query Analyser, but when I run my VB program I get the eror: I get the message : An SqlParameter with ParameterName'@.total' is not contained by this SqlParameterCollection.


Here is my stored Proc and my VB program is right below

I- Stored Proc:

CREATE PROCEDURE dbo.totalsub
@.account bigint,
@.total bigint output
AS
select total=sum(SubPhnNmbr) from tblsub whereSubAccNmbr=@.account
return
GO

II- And my pogram in VB is:

Dim totsub As Int64
Dim cm As New SqlCommand
Dim cn As New MyConnection
cn.open
'my connection is defined by me don't worry about it
cm.CommandType = CommandType.StoredProcedure
cm.CommandText = "totalsub"
cm.Connection = cn
Dim pm As SqlParameter
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Account", System.Data.SqlDbType.BigInt))
pm.Value = 100000165
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("total", System.Data.SqlDbType.BigInt, 4))
pm.Direction = ParameterDirection.Output
totsub = cm.Parameters("total").Value
cm.ExecuteScalar()
totsub = cm.Parameters("total").Value


I also tried using @.total instead of total and I tried ParameterDirection.ReturmValue instead of ParameterDirection.Output

No Luck, someone pls can help

check the second part ofthis article.|||Thanks.

Friday, February 24, 2012

Hyperlink is not working

Dear all,

I would like to ask a question here about the hyperlink in reporting service.

I have programmed a report and it runs perfectly in my PC. Unfortunately when I deployed it to a server, the hyperlinks in that report can not be clicked. Is it because of the version at the server which is 9.00.2047.00? My development version is 9.00.3042.00.

Hope can hear from you soon. Thanks in advance.

Hi,

Not sure if this is a version issue, do you have a sub-report linked witht the hyperlink, if yes are you deploying that also to server....

|||

I have the same issue but my hyperlink has linked with other report with parametrs but doesn't work.

|||

Hi,

Parameters can be the problem. About using something like that for a report with parameters?

http://reporting.onsemi.com/ReportServer/Pages/ReportViewer.aspx?%2fProduct+Reports%2fProduct+Launch+Packages&rs%3aCommand=Render&Division=%23%23&RTM_Bucket=Last%206%20months

or something like that for another web site with parameters in the URL?

="javascript:void window.open('http://www.onsemi.com/PowerSolutions/product.do?id=" & CStr(Fields!WEB_PART_NAME.Value) & "&ppt=Y','_blank')"

or any combination of the above.

Note that in preview mode, the java script version will not work. It works only from the browser.

Regards,

Philippe