Results 1 to 5 of 5

Thread: problems with ASP.net & CReports

  1. #1

    Thread Starter
    Member Canibus's Avatar
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    61

    problems with ASP.net & CReports

    hi!

    i have the following code below, but it gives me errors.
    please help!

    Dim myConn As SqlConnection = New SqlConnection(connString)
    Dim strSQL As String
    strSQL = " SELECT c.citymame, ct.coutryname, ct.countryabbr, s.statename, s.stateabbr" _
    & " FROM city c,coutrytable ct,state s" _
    & " WHERE c.countryid = s.countryid " _
    & " AND s.stateid = c.stateid "

    Dim cmd As SqlCommand = New SqlCommand
    cmd.Connection = myConn
    cmd.CommandType = CommandType.Text
    cmd.CommandText = strSQL

    Dim myDA As New SqlDataAdapter

    myDA.SelectCommand = cmd
    Dim myDS As New Dataset1
    'problem here
    ' myDA.Fill(myDS, "countrytable")


    Dim orpt As New CrystalReport2
    orpt.SetDataSource(myDS)

    CrystalReportViewer1.ReportSource = orpt

    Canibus Signs out!!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    It would help if you actually told us what the error is.

  3. #3

    Thread Starter
    Member Canibus's Avatar
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    61
    Sorry bout that.


    myDA.Fill(myDS, "countrytable")

    >> here's the error descrp.

    Invalid object name 'coutrytable' @ the
    cmd.executereader
    Canibus Signs out!!

  4. #4
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Shouldn't that be country table ?

  5. #5

    Thread Starter
    Member Canibus's Avatar
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    61
    Why must i separate the name like that... from 'countrytable' to 'coutry table'?
    Does it have any effect on the way i retrieve data or anything?
    Canibus Signs out!!

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