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 "
dim sql as string
sql="select query using parameters"
dim cmd as new System.Data.SqlClient.SqlCommand
dim retval =cmd.ExecuteScalar()
if retval is system.dbnull.value then
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.