PDA

Click to See Complete Forum and Search --> : [vs2005]Filling a dataset in code behind but not showing in crystal


mornevd
Oct 17th, 2007, 08:37 AM
I have a asp.net project with a crystal report. I created a dataset now I've tried to fill it but it doesnt show in my crystal report. can anybody help. Here is my code behind's code


Public Function Wanted() As Data.DataTable
Try
'Dim strConnection As String = "..."
'Dim Connection As New Data.OleDb.OleDbConnection(connclass.INITSQL)

Dim DS As New Data.DataSet
Dim DA As New Data.SqlClient.SqlDataAdapter



Dim strSQL As String = "Select * From MIS_PART1"

DS.Clear()
adoconn = connclass.INITSQL
adoconn.Open()
DA = connclass.INITADAPTER(adoconn, strSQL)
DA.Fill(DS, "dsWanted")

Return DS.Tables("dsWanted")
Me.CrystalReportSource1.DataBind()
Me.CrystalReportViewer1.DataBind()



'Me.CrystalReportSource1.DataBind()
'DS.WriteXmlSchema("C:\Dev\MySchema.xsd")

Catch ex As Exception
'some error handling
End Try
End Function

brucevde
Oct 17th, 2007, 10:00 AM
The Return statement causes execution to immediately return to the calling procedure. Like the Exit Function statement in VB 6.

Any code after a Return statement will not execute.