cancel
Showing results for 
Search instead for 
Did you mean: 

CR VS 2010 SQL query issue

Former Member
0 Kudos

Hi all

I'm facing a problem with my code.

Dim cr As New CrystalReport1()

Dim newCmd As SqlCommand

Dim conn As SqlConnection

Dim da As New SqlDataAdapter

Dim ds As New DataSet

Dim cr As New CrystalReport1


Dim MyConnectionStr As String = "Data Source=MyDB;Initial catalog=MyCat;Integrated Security=true;" ' providerName=System.data.sqlClient"


conn = New SqlConnection(MyConnectionStr)


Dim cmdText As String

    cmdText= " SELECT customer.customer_name, customer.customer_tel, orders.order_stuff_name, orders.order_number" & _
" FROM   hesabres.dbo.orders orders inner JOIN hesabres.dbo.customer customer ON orders.order_customer_id=customer.customer_id"

da = New SqlDataAdapter(newCmd)

da.fill(ds)

cr.SetDataSource(ds.Tables(0))

crystalviewer1.ReportSource = cr

conn.Close()

  newCmd.Dispose()

if i run the query, let's say it returns 2 rows

I my CR veiwer, it shows 4 rows  (duplicates 2 x 2),

if the query returns 3 rows, CR displays 9 rows (3 x 3) and so on 10 (10x10)....

How is it possible??

In my Dataset, the number of rows is always correct!

Do you have any idea?

Thanks in advance.

B.

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Which version of the Crystal SDK assemblies are you referencing in your project?

Former Member
0 Kudos

Hi,

The version referenced in my vb 2010 project is Crystal Decision .NET version 13.0.2000.0

DellSC
Active Contributor
0 Kudos

I would look at upgrading to a more recent version of Crystal for VS - you're on SP2 which is quite old.  You can download the latest SP from here:  http://scn.sap.com/docs/DOC-7824

While I can't guarantee this will fix the problem, it might help.

-Dell

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

See this wiki on how to troubleshoot issues with CR and datasets:

Troubleshooting Issues with VS .NET Datasets and Crystal Reports - Business Intelligence (BusinessOb...

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center
Canada

Follow us on Twitter

Former Member
0 Kudos

Hi,

Thanks for your answer but unfortunately, it didn't help me.

Do you have any idea about my issue? To put me on the right way?

former_member183750
Active Contributor
0 Kudos

What do you mean by "...it didn't help me."? What did you find out by following the troubleshooting steps outlined in the wiki I referenced?

- Ludek