Results 1 to 2 of 2

Thread: [vs2005]Filling a dataset in code behind but not showing in crystal

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    31

    [vs2005]Filling a dataset in code behind but not showing in crystal

    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

    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
    I use Visual Studio 2005 and code in VB.Net and C# and ASP.NET, as well as Crystal reports
    If my post helped or my Question was good pls rate me!!!

    MORNE

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: [vs2005]Filling a dataset in code behind but not showing in crystal

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width