Wrox Programmer Forums
|
BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7
This is the forum to discuss the Wrox book Professional SQL ServerReporting Services by Paul Turley, Todd Bryant, James Counihan, George McKee, Dave DuVarney; ISBN: 9780764568787
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2007, 12:53 PM
Registered User
 
Join Date: Mar 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sql server custom code issue

I created a report in SQL Server 2005 using SQL Server 2005. I added a custom code to the report as:

function getpiececount_parent(byval qb_prodcode as string,byval s_date as string,byval e_date as string)

            dim conn as new System.Data.SqlClient.SqlConnection

            conn.ConnectionString= "Data Source=xxxx;Initial Catalog=xxxx;User Id=xxxx;Password=xxxxx "

            conn.open()

            dim sql as string

            sql="select query using parameters"

            dim cmd as new System.Data.SqlClient.SqlCommand

            cmd.connection=conn

            cmd.commandtext=sql

            cmd.Parameters.AddWithValue("@stDate",s_date)

            cmd.Parameters.AddWithValue("@edDate",e_date)

            cmd.Parameters.AddWithValue("@qbprodcode",qb_prodc ode)



            dim retval =cmd.ExecuteScalar()

            if retval is system.dbnull.value then

                        retval=0

            end if



            cmd.dispose()

            conn.close()

            return retval

end function



For the above function I added reference to the System.Data . The report works as desired when I execute in the VS 2005 IDE but when I deploy the report on the reporting server and execute it from there the function doesn’t execute and returns me #Error.

Can any one provide some insight into it to as to how i can resolve this issue.




 
Old February 13th, 2008, 08:24 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try these links:
http://blogs.sqlxml.org/bryantlikes/pages/824.aspx
http://msdn.microsoft.com/library/en...er_v1_1nfp.asp






Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
SQL Server 2000 connectivity issue avixorld ASP.NET 2.0 Professional 8 July 25th, 2007 09:17 AM
SQL Server Mobile 5 issue in VS.NET rodmcleay Visual Studio 2005 0 July 10th, 2006 11:49 PM
Usizing issue Access to SQL Server gvcooper Pro VB 6 0 April 30th, 2006 05:09 AM
SQL Server Publish & Subscribe issue Greg Griffiths SQL Server 2000 1 August 18th, 2004 02:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.