VB.NET,SQL SERVER 2000 STORED PROCEDURE PARAMETERS, CRYSTAL REPORTS 
Author Message
 VB.NET,SQL SERVER 2000 STORED PROCEDURE PARAMETERS, CRYSTAL REPORTS

How do I pass a discrete value to a parameter for a sql server 2000
stored procedure in code for a vb.net application using crystal
reports 9.0?  For example, using the pubs database, I have a stored
procedure which selects records from the authors table using a single

to pass a discrete value to that parameter in code so that the crytal
reports viewer displays the appropriate records. Thanks!


Mon, 14 Feb 2005 05:09:54 GMT  
 VB.NET,SQL SERVER 2000 STORED PROCEDURE PARAMETERS, CRYSTAL REPORTS
Hi John,

I don't know what you need to do with Crystal, but here is some sample code
to set parameters on a stored procedure:

-drag and drop your stored procedure from server explorer
 *in code, take a look at your InitComponet -- this created Parameters
objects and set them off of your SQLCommand)
-Now you can set parameter values in code and execute the stored procedure
like this:

        Dim retval As String

        Try
            Me.SqlConnection1.Open()



            retval = Me.SqlCommand1.ExecuteScalar()
            MsgBox("return value = " & retval)

        Catch ex As Exception
            MsgBox(ex.ToString)
        Finally
            Me.SqlConnection1.Close()
        End Try

Hope that does the trick,

Dave, Matt, and Paul
Visual Basic .NET team

--
This posting is provided "AS IS" with no warranties, and confers no rights.
---

Quote:
> How do I pass a discrete value to a parameter for a sql server 2000
> stored procedure in code for a vb.net application using crystal
> reports 9.0?  For example, using the pubs database, I have a stored
> procedure which selects records from the authors table using a single

> to pass a discrete value to that parameter in code so that the crytal
> reports viewer displays the appropriate records. Thanks!



Tue, 01 Mar 2005 03:38:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Crystal Reports 8.5, SQL Server 2000, and Stored Procedures

2. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

3. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

4. Crystal Report based on SQL Server Stored Procedure with Parameters

5. Calling Crystal Report from VB, repo is based on Stored Procedure in Sql Server

6. ASP.net VB.Net Stored Procedures in SQL Server

7. Linking Crystal Report with a stored Procedure -- crystal report for visual studio.net

8. Pass parameter to a MS SQL stored procedure from Crystal Report 6.0

9. New Stored Procedure Parameter (SQL Server 7) isn't recognized in CR7 Report Designer

10. doing updating from grid to sql server with stored procedure sql 2000

11. Assign Stored Procedure of SQL Server with Crystal report

12. Problem with VB passing parameters to Crystal Report - Stored Procedure

 

 
Powered by phpBB® Forum Software