Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: Data connection from code Post Reply Post New Topic
Author Message
cowboy the duck
Newbie
Newbie
Avatar

Joined: 15 Apr 2009
Location: United States
Online Status: Offline
Posts: 1
Quote cowboy the duck Replybullet Topic: Data connection from code
    Posted: 15 Apr 2009 at 2:02pm
I have built a web app in VS.net 2008 and in VB.net.  It is to genereate a CR from a sql db based on the selection of user on webpage.  My app dynamically creates a table in sql that is to be the datasource for the CR.
 
The app pushes the contents of this table into a dataset/datatable dynamically.  That works great.  My problem is I cannot figure out how to have my code connect to this dataset once it is created.
 
I have created the dataset in my project as an xsd file with all the correct fields.  The program removes the records and re-populates this table at run time.  i wonder if the fact that the program remove the data from the sql table at runtime causes the connection to not happen.
 
This is the code for the last attempt that I tried;
 

finalsql = "SELECT * from dbo.tblStudentVerify"

Dim myadapter As New SqlDataAdapter(finalsql, myconn)

Dim myDS As New DataSet()

myDS.Tables.Add("tblStudentVerify")

myadapter.Fill(myDS, "tblStudentVerify")

Dim myRpt As New ReportDocument

myRpt.Load("C:\\inetpub\\wwwroot\\StudentVerification\\Student_Verify\\CrystalReport.rpt")

myRpt.SetDataSource("StudentVerifyDataSet_tblStudentVerify")

CrystalReportViewer.DisplayGroupTree = False

CrystalReportViewer.Visible = True

CrystalReportViewer.ReportSource = myRpt

CrystalReportViewer.DataBind()

CrystalReportViewer.RefreshReport()

Please help!  Thanks!
 
 
John Mitchell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.