473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Error In Binding Data To Crystal Report

SqlConnection cn=new SqlConnection ("User ID=sa;Initial Catalog=usermodule;Data Source=NEW5");
SqlDataAdapter da=new SqlDataAdapter (Application["str1"].ToString(),cn);
DataSet ds=new DataSet();
da.Fill (ds,"REGISTER,INOUTDETAILS");

CrystalReport1 cr=new CrystalReport1();
cr.SetDataSource(ds.Tables[0]);
CrystalReportViewer1.ReportSource=cr;
The above statement represents binding data to crystal reports.

My problem is I am getting error in this statement

cr.SetDataSource(ds.Tables[0]);
The error is Invalid table no.

What is the correct statement.

please help me.........
Oct 6 '06 #1
2 1848
radcaesar
759 Expert 512MB
Whats the Error u had got ?

:)
Oct 6 '06 #2
Instead of using a dataset, try using a DataTable you can use this
DataTable dt = new DataTable();
da.Fill(dt);
then bind the report to that datatable. Alternatively, instead of using the Index of the table you could use the keyname of the datatable for example
ds.Tables["REGISTER,INOUTDETAILS"]
Oct 6 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Plunaldo | last post by:
Hi All I use a ODBC Connection to Connect to a AS400 System. I created a new DSN in the Windows System. The Databaseaccess is made directly out of the Crystal Report...so the Crystal Report is...
1
by: saima ashraf | last post by:
Hi, I am trying to sort the data in my crystal report at runtime. The problem is that i can only query the database once and that is at the loading of the report. At that time i fill up my...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
10
by: Jim Underwood | last post by:
I am having a problem with my web page timng out while retrieving a long runnign report (90-120 seconds. I have tried modifying several settings in various places and cannot get it to run for more...
0
by: Tumurbaatar S. | last post by:
It's my first project using the Crystal report. I created a report with the report designer and linked it to a web form as: 1. put CrystalReportViewer in my page (its ID: Viewer). 2. put...
1
by: =?Utf-8?B?a2thcnJl?= | last post by:
Hello, We want to use Crystal Reports to print a page with customer info. However, we cannot connect a new report to our object! We have looked at the samples and done the same but to no avail....
6
by: Miro | last post by:
I can run an exe ( and its install ) i have created on my machine. The exe has a button that populates a dataset and then shoots it to a crystal report. But... Installing the setup.exe on my...
4
by: Miro | last post by:
<i have also added this reply to the other newsgroup - now that I have realizd ( and assuming ) it is not a localized error directly to vb.> I have found this link on the website:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.