Print Page | Close Window

Using Dataset, odbcdataAdapter

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1695
Printed Date: 16 May 2024 at 11:49pm


Topic: Using Dataset, odbcdataAdapter
Posted By: salaikumar
Subject: Using Dataset, odbcdataAdapter
Date Posted: 16 Nov 2007 at 6:46am
Hello
i have a problem in the foll code. I am trying to pass a sql query to a report(CRXI r2). But the dataset in the foll code returns null i suppose. the error message(inner exception) is given below..
 

Dim odbcAdapter As New OdbcDataAdapter()

odbcAdapter.SelectCommand = New Odbc.OdbcCommand(StrSql, OpenSQLConnection)

MessageBox.Show(odbcAdapter.SelectCommand.CommandText)

odbcAdapter.Fill(objds, "testtable)

objReport.SetDataSource(objds)

objClsCrystalRptVw.ReportSource = objReport

error message:
{"Object reference not set to an instance of an object."}
 
can anyone help me
 



Replies:
Posted By: TomN
Date Posted: 22 Jan 2008 at 4:43pm

I do not see you create dataset 'objds' in the code!




Print Page | Close Window