Advertisement
Advertisement
| 04.21.2008 at 08:31AM PDT, ID: 23339912 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
Dim rpt As New CrystalReport1 ' report created
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand
Dim myDA As New SqlDataAdapter
Dim myDS As New Dataset3 ' Dataset created
Try
myConnection = New SqlConnection(Application("A1SConnString"))
'Dim cmd As New SqlCommand("GetSalesTPR", myConnection)
' cmd.CommandType = CommandType.StoredProcedure
MyCommand.Connection = myConnection
MyCommand.CommandText = "Select * From SalesTPR where UserID = 'aprice'"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
'Dim prm As New SqlParameter("@UserID", SqlDbType.VarChar, 50)
'cmd.CommandType = CommandType.StoredProcedure
'prm.Value = ReadCookie(Tokens.UserId)
'cmd.Parameters.Add(prm)
myDA.Fill(myDS, "SalesTPR")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
|