Oracle 5.0 Reference Manual page 1950

Table of Contents

Advertisement

End Try
C# Example
using CrystalDecisions.CrystalReports.Engine;
using System.Data;
using MySql.Data.MySqlClient;
ReportDocument myReport = new ReportDocument();
DataSet myData = new DataSet();
MySql.Data.MySqlClient.MySqlConnection conn;
MySql.Data.MySqlClient.MySqlCommand cmd;
MySql.Data.MySqlClient.MySqlDataAdapter myAdapter;
conn = new MySql.Data.MySqlClient.MySqlConnection();
cmd = new MySql.Data.MySqlClient.MySqlCommand();
myAdapter = new MySql.Data.MySqlClient.MySqlDataAdapter();
conn.ConnectionString = "server=127.0.0.1;uid=root;" +
"pwd=12345;database=test;";
try
{
cmd.CommandText = "SELECT name, population, countrycode FROM city ORDER " +
"BY countrycode, name;
"country ORDER BY continent, name";
cmd.Connection = conn;
myAdapter.SelectCommand = cmd;
myAdapter.Fill(myData);
myReport.Load(@".\world_report.rpt");
myReport.Database.Tables(0).SetDataSource(myData.Tables(0));
myReport.Database.Tables(1).SetDataSource(myData.Tables(1));
myViewer.ReportSource = myReport;
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show(ex.Message, "Report could not be created",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
It is important to order the
its source tables to be in. One SetDataSource statement is needed for each table in the report.
This approach can cause performance problems because Crystal Reports must bind the tables
together on the client-side, which will be slower than using a pre-saved data set.
20.2.5.18. ASP.NET Provider Model
MySQL Connector/Net provides support for the ASP.NET 2.0 provider model. This model enables
application developers to focus on the business logic of their application instead of having to recreate
such boilerplate items as membership and roles support.
MySQL Connector/Net supplies the following providers:
• Membership Provider
• Role Provider
• Profile Provider
• Session State Provider (MySQL Connector/Net 6.1 and later)
The following tables show the supported providers, their default provider and the corresponding
MySQL provider.
Membership Provider
Connector/Net Programming
SELECT
name, population, code, continent FROM " +
queries in alphabetic order, as this is the order the report will expect
SELECT
1930

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents