Page 1 of 1

data source

Posted: Fri May 07, 2010 7:01 am
by majidsoft
hi evvery body i use crystal report to design my report but now i want to create a report with stimul but i cant do that i use this code to filter my information to send to the report please see my code and say me the correct code
thanks

Code: Select all

 Dim cnn As SqlConnection = Fn_Get_SqlConnection()
        Dim ds As New DataSet
        Dim Cmd1 As SqlDataAdapter = New SqlDataAdapter("Select * from rest where (pri=" & 1 & ") and ((code=" & txtcode.Text & "))", cnn)
        Cmd1.Fill(ds, "rest") : Dim rpt As New cry2 : rpt.SetDataSource(ds)
        frmreport.CrystalReportViewer1.ReportSource = rpt : frmreport.Show()

data source

Posted: Fri May 07, 2010 7:51 am
by Jan
Hello,

Please check attached sample project.

Thank you.

data source

Posted: Sat May 08, 2010 4:14 am
by majidsoft
thenks for your attention
but this code in this code when im in a designer when i want to create a parameter i write this code
select * from information where code=@code
when i use this code in access database there is no any problem but when i use this code to sql server i found a error on it
but if i write this code
select * from information where code=12
i found no any problem

data source

Posted: Sun May 09, 2010 12:25 pm
by Jan
Hello,

Can you provide more details about problem which you have with parameter? Any error messages or something also?

Thank you.