Two methods for using rdcl reports/adding two table_ax for Dataset

Source: Internet
Author: User
Do not understand the specific steps, see: http://www.cnblogs.com/AXzhz/services/trackbacks/700305.aspx
Method 1:
Create a data source and Dataset. You can run the dataset with simple settings in reportviewer.

Method 2:
Data Source instance Both Set to none,
Add the following in the background: Code ,
Private   Void Form1_load ( Object Sender, eventargs E)
{
String SS =   @" Provider = Microsoft. ace. oledb.12.0; Data Source = c: \ Documents and Settings \ axzhz \ My Documents ents \ Visual Studio 2005 \ projects \ ax \ windowsapplication10 \ windowsapplication10 \ database1.mdb; persist Security info = false " ;
Oledbconnection con =   New Oledbconnection (SS );
Oledbdataadapter da =   New Oledbdataadapter ( " Select * From Table1 " , Con );
Oledbdataadapter da1 =   New Oledbdataadapter ( " Select * From Table2 " , Con );
Dataset DS =   New Dataset ();
Da. Fill (DS, " Table1 " );
Da1.fill (DS, " Table 2 " );

This . Reportviewer1.localreport. CES. Add ( New Reportdatasource ( " Ds_table1 " , DS. Tables [ 0 ]);
This . Reportviewer1.localreport. CES. Add ( New Reportdatasource ( " Ds_table2 " , DS. Tables [ 1 ]);

This . Reportviewer1.localreport. reportembeddedresource = " Windowsapplication10.report1. rdlc " ;

This . Reportviewer1.refreshreport ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.