Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do multiple data sources?
Message
From
20/04/2010 08:02:54
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
 
 
To
19/04/2010 16:55:27
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01460976
Message ID:
01461058
Views:
34
Tim,

A different business object ~project~ for each data source... that's a paradigm I wasn't seeing. I understand your comments about naming objects. And also the differences if both data sources are identical. In my case, these are very different objects, with very different data structures on the backend.

Thanks,
Guy





>Hi Guy,
>
>There are a couple of different approaches depending on the data and purpose. If the data in the different data sources is not the same data, then yes, just create another Business Object Project for connecting to a second data source/ type. Set the connection in the app.config just like in your other project for that specific data. This connection is used for the development purpose. You also need to have the database key name set in your ABusinessObject. Basically everything is identical to creating your first business object project.
>
>Now in your web or windows application, add the new business object project. You should now have two of them. You will need to have another connection defined in your web.config or app.config of the application project so that you would have two of them; one for each business project. Also add the refrences to both business projects in your application references.
>
>Keep in mind you will need to be careful with names to make it easier on you. For instance don't have a business object named Orders in one business project and a business object named orders in the other as well if you can avoid it. If you must do that, you can do this no problem, but you will have to deal with it specifically.
>
>In a form where you are going to get data from both business object projects you just add a using statement for both projects and register them just like any other time.
>
>If the data is identical in each data source than you are better off not creating two busines object projects. The sample application ships with MM has both sql data and fox data but only one business project and set of entities. In that case you can switch between the data types using datasets defined like the sample or you can do it manually.
>
>I hope that helps
>Tim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform