This is a migrated thread and some comments may be shown as answers.

How to connect with other data provider

2 Answers 392 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sand
Top achievements
Rank 1
sand asked on 19 May 2007, 03:44 PM
Sorry i'm quiet in english.. But i got some question.
How connect report with other data provider such as OLEDB ,MySQL etc.
I'm cann't find any related subject ..  In your all sample use SqlDataAdapter
so provide for MS SQL Server.. But in my project I need to uses MySqlConnector.Net
,so how ?





2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 19 May 2007, 03:59 PM
In addition to SqlDataAdapter (optimized for SQL Server 2005/Sql Express), you can use OdbcDataAdapter or OleDbDataAdapter to connect to other 3rd party databases, like MySQL.

Here is a nice online article demonstrating this:
http://www.aspnet101.com/aspnet101/tutorials.aspx?id=39

And here is the Data Adapters section from Reporting Help, which might be relevant to your case (same steps below apply for all types of Adapters):

<quote>
You can add a data source to a report by setting the DataSource property of the report to the name of a DataAdapter component (such as a SqlDataAdapter, OdbcDataAdapter, or OleDbDataAdapter). For example, to use a SqlDataAdapter to specify the data source for a report, follow these steps:

You will need a SqlDataAdapter component from the Toolbox. By default, this component is not visible in the design view of a Telerik Report. Right-click the Telerik Reporting 1.0 tab in the Toolbox and select Choose Items.
In the Choose Toolbox Items dialog box, select the check box for the SqlDataAdapter item. Click OK.
Drag a SqlDataAdapter component from the Toolbox to anywhere on the report.
In the Data Adapter Configuration Wizard, click New Connection.
In the Add Connection dialog box, enter the server name and log on information for your SQL Server. Select or enter a database name.
Click OK.
Click Next.
Select Use SQL Statements.
Click Next.
Type a SQL statement that specifies the data for the report. Click Finish.
Select the Report (to do this easily, click in the box at the upper left where the rulers meet).
Set the DataSource property of the Report to sqlDataAdapter1.

</quote>
0
Svetoslav
Telerik team
answered on 22 May 2007, 03:54 PM
Hello,

We have attached a sample project that demonstrates how to use MySQL ADO.NET 2 data provider with the Telerik Reporting.

Generally, the ADO.NET 2.0 data providers are all used in a similar manner. All data provides come with a standard set of objects. All these objects are derived from base classes mandated from the ADO.NET 2. This way all data provider specific objects have similar and well known interface. The base classes I'm talking about are defined in the System.Data.Common namespace (System.Data.dll) and here are some of the most important:
  • DbConnection
  • DbCommand
  • DbDataAdapter
  • DbDataReader
A good place to learn more about the ADO.NET 2 data providers is MSDN: http://msdn2.microsoft.com/en-us/library/cy5kfe3c(VS.80).aspx .

The idea behind the ADO.NET2 data providers is that they simplify their usage and are interchangeable. This means that they all follow the same pattern regardless of your connection to SQL, Oracle, Access, MySQL or other data base. The only thing that you should do is to use the correct set of objects.
 

All the best,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
sand
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Svetoslav
Telerik team
Share this question
or