List:MySQL ODBC« Previous MessageNext Message »
From:Vin Rao Date:December 15 2005 6:58am
Subject:Invalid Table Name
View as plain text  
  Hello experts,
   
   
    I have a problem saying
CrystalDecisions.CrystalReports.Engine.InvalidArgumentException: Invalid column name when
i want to view a report using MYSQL 5.0 database.
   
   The code looks like this
   
  Imports System
Imports MySql.Data
Imports MySql.Data.MySqlClient
Imports System.Data
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.CrystalReports.Engine.Tables
  
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
        'Put user code to initialize the page here
         
        Dim myReport As New ReportDocument
        
        Dim mycon As MySqlConnection
        Dim mycmd As MySqlCommand
        Dim myda As MySqlDataAdapter
        Dim myds As New DataSet
  
        mycon = New MySqlConnection("Server=localhost;database=wvts;uid=root;pwd=sakith")
        ' mycmd = New MySqlCommand("Select * from test", mycon)' where test is my table
name with columns col1 and col2
          mycon.Open()
        myda = New MySqlDataAdapter("Select * from test", mycon)
        myda.Fill(myds, "test")
          'myReport.Load(".\TestCrystalReport.rpt")
        myReport.Load("C:\Inetpub\wwwroot\WVTS\TestCrystalReport.rpt")
        'myReport.Database.Tables(8).SetDataSource(myds.Tables(8))
        myReport.Database.Tables("test").SetDataSource(myds.Tables("test"))
          myReport.SetDataSource(myds)
        CrystalReportViewer1.ReportSource = myReport
          mycon.Close()
  End Sub
   
   
  Please help me out with this
  Thanks
  Vin


			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
Thread
Invalid Table NameVin Rao15 Dec