Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Passing Parameter to Stored Procedure SQL in crystal report with vb.net

$
0
0

Hello, 

I have some problem about passing parameter to stored procedure SQL in crystal report with VB.net

So, this is my code :

comd = New SqlCommand
comd.Connection = con
comd.CommandText = "sp_rpt_CLFPAY"
comd.CommandType = CommandType.StoredProcedure

Dim SqlParam(2) As SqlParameter

SqlParam(0) = comd.Parameters.Add("@lease_no", SqlDbType.VarChar, 9)
SqlParam(0).Direction = ParameterDirection.Input
SqlParam(0).Value = "101010100"

SqlParam(1) = comd.Parameters.Add("@branch_cd", SqlDbType.VarChar, 2)
SqlParam(1).Direction = ParameterDirection.Input
SqlParam(1).Value = "10"

SqlParam(2) = comd.Parameters.Add("@user", SqlDbType.VarChar, 50)
SqlParam(2).Direction = ParameterDirection.Input
SqlParam(2).Value = "natalia"

Dim MyDA As New SqlDataAdapter
MyDA.SelectCommand = comd

Dim MyDataTable As New DataTable
MyDA.Fill(MyDataTable)

RptDoc.Load(Server.MapPath("~/RptETAppr_SP.rpt"))
RptDoc.SetDataSource(MyDataTable)

CrystalReportViewer1.ReportSource = RptDoc
CrystalReportViewer1.DataBind()

My Problem is the parameter can't called in stored procedure, and i have nothing in my report. 

So, anyone could help me about my problem ? Please reply with the solved problem. 

Thanks.

Best Regards,

Natalia. H


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>