Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datareader for report?

Status
Not open for further replies.

slwolf8

Technical User
Apr 23, 2001
82
US
Is it possible to attach a datareader to a crystal report? I successfully attached a report to a dataset but can't figure this one out. Here is the code I tried (vb.net):

Dim SqlConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("SqlConn"))
Dim cmd1x1x61 As SqlCommand = SqlConn.CreateCommand
cmd1x1x61.CommandType = CommandType.StoredProcedure
cmd1x1x61.CommandText = "sp1x1x61"

Try
SqlConn.Open()
cmd1x1x61.ExecuteReader()
crv1x1x61.ReportSource = rpt1x1x61
rpt1x1x61.SetDataSource(cmd1x1x61)
crv1x1x61.DataBind()
Catch ex As Exception
Finally
cmd1x1x61.Connection.Close()
SqlConn.Close()
End Try
 
sorry, i have this as a public variable:

Public rpt1x1x61 As bakcr1x1x61 = New bakcr1x1x61
 
I should also say why I want to do it this way. I don't want to use a dataset because it is very very slow for the number of records we have.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top