Forward Mapping using Class Library

4 posts, 0 answers
  1. Srinivas Chitta
    Srinivas Chitta avatar
    9 posts
    Member since:
    Dec 2009

    Posted 22 Feb 2010 Link to this post

    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

  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 25 Feb 2010 Link to this post

    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.
  3. DevCraft banner
  4. Srinivas Chitta
    Srinivas Chitta avatar
    9 posts
    Member since:
    Dec 2009

    Posted 08 Mar 2010 Link to this post

    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
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 11 Mar 2010 Link to this post

    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.
Back to Top