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

Forward Mapping using Class Library

3 Answers 79 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Srinivas Chitta
Top achievements
Rank 1
Srinivas Chitta asked on 22 Feb 2010, 07:56 AM
Hi,

I have used Class Library while writing the code for reverse mapping and has generated the library (DLL) out of it. I am using this DLL in another web project that solves my criteria. Now the situation is that, i need to change the database from SQL Server to My SQL and use forward mapping to create the database. Can i import the same DLL (generated from Reverse Mapping) into the application and use forward mapping? Or do I need to generate from the .cs files written at the time of reverse mapping.

Hope you can understand the scenario.

Waiting for your inputs on this....


Thanks
Srinivas

3 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 25 Feb 2010, 11:00 AM
Hi Srinivas Chitta,

 Yes, you can use the same dll (Persistent classes) to work against MySql. Here is what you can do
  1. Copy the connection node (in the app.config) for SqlServer in case you want to still use the dll for SqlServer, and maybe specify a relevant connection id value - DatabaseConnectionMssql
  2. Enable the dll project again using the 'Enable Project' wizard and this time specify MySql as the backend with the appropriate connection settings.The point is to have a connection node for each backend that you want to access using the Persistent classes. The connection id name decides which backend will be used.
  3. In the project properties, specify the connection id for MySql and use the Forward mapping wizard to customize the schema properties like table or column names etc.
  4. Build the project to create the database in MySql.
  5. In your web application you need to use the appropriate connection id in order to connec to MySql.
  6. Here is a similar topic,although not exactly the same, on how to access multiple databases.

 Hope this helps

Kind regards,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Srinivas Chitta
Top achievements
Rank 1
answered on 08 Mar 2010, 08:03 AM
Hi Ady

Thanks for your reply. I got the exactly what I am expecting. But now the scenario is that, assume i am at client's place and needs to install my application. I have a DLL (Data Access Component) with me. To use forward mapping, I need visual studio along with the persistent classes to generate the database. But at the client side, I don't have any software accessible to me. With the existing DLL, is there any possibility that I can work with Forward Mapping and create the database?

Waiting for your immediate reply...

Thanks and Regards,
Srinivas
0
Ady
Telerik team
answered on 11 Mar 2010, 02:49 PM
Hi Srinivas Chitta,

 Yes, this is possible to achieve without having the OpenAccess product installed.
You can do this using the VSchema tool as described here or use the SchemaHandler api to achieve this programmatically.

Hope this helps.  Do get back to us in case you have further questions.

Best wishes,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Data Access Free Edition
Asked by
Srinivas Chitta
Top achievements
Rank 1
Answers by
Ady
Telerik team
Srinivas Chitta
Top achievements
Rank 1
Share this question
or