StrataFrame Forum

Can I use an ole db connection to a Sybase database with the Business Object Mapper?

http://forum.strataframe.net/Topic24356.aspx

By powernicholas - 8/28/2009

Can I use an ole db connection to a Sybase database with the Business Object Mapper?

Our entire backend is Sybase and Sql anywhere...and I need to know if I can use the tools with these.

Thanks

By Peter Jones - 8/29/2009

Hi,



Not that I've ever used it but, in the mapper, I'm pretty sure there is specific selection for an OLE DB connection plus you can use a connection string at the foot of the form.



If you are looking for help with connection strings then: http://www.connectionstrings.com/ is a great resource.



Cheers, Peter
By powernicholas - 8/31/2009

Well see now the problem is I use ole db connections all the time with .net and sql anywhere/sybase

however, when I put my confirmed working connection strings into the object mapper... i don't get anything

We are strongly considering buying this product, but if I can't make it work...we will have to look elsewhere

By Greg McGuffey - 8/31/2009

SF should work fine with OLEDB connections. Just to be clear what's been done, this is what you should have done:



1. In VS, added a BO. At this point you just give it a name.

2. Open the BO Mapper, it will search through project(s) and show them in a list. They won't be configured.

3. Click on the project in your solution with the BO, then click on Configure project in panel on right.

4. This opens up a configuration form. You'd select OLE and then enter your connection string. I'd highly recommend that you just use the builder, which will test the connection while building it.

5. Click OK to save those changes.

6. Expand the project and you should see your BO, but it isn't configured.

7. Click on it then click on configure in right panel.

8. Select database, then table/view and click OK.

9. Now there should be a list of columns, pulled from table selected.

10. Right click on BO and select Build Partial.

11. After it is done, close dialog and BO is ready for use....



Except that you need to setup the runtime connection in AppMain.vb (program.cs if C#). In the SetDataSources method, you'll need to either setup a required data source with the connection manager OR just set the datasource up manually. I'd recommend using the first method until you get a bit farther along. Have you done all of this? If so were is it breaking?
By powernicholas - 9/2/2009

Greg McGuffey (08/31/2009)
SF should work fine with OLEDB connections. Just to be clear what's been done, this is what you should have done:

1. In VS, added a BO. At this point you just give it a name.
2. Open the BO Mapper, it will search through project(s) and show them in a list. They won't be configured.
3. Click on the project in your solution with the BO, then click on Configure project in panel on right.
4. This opens up a configuration form. You'd select OLE and then enter your connection string. I'd highly recommend that you just use the builder, which will test the connection while building it.
5. Click OK to save those changes.
6. Expand the project and you should see your BO, but it isn't configured.
7. Click on it then click on configure in right panel.
8. Select database, then table/view and click OK.
9. Now there should be a list of columns, pulled from table selected.
10. Right click on BO and select Build Partial.
11. After it is done, close dialog and BO is ready for use....

Except that you need to setup the runtime connection in AppMain.vb (program.cs if C#). In the SetDataSources method, you'll need to either setup a required data source with the connection manager OR just set the datasource up manually. I'd recommend using the first method until you get a bit farther along. Have you done all of this? If so were is it breaking?

Oh..okay so here is my main question.  I have been programming in .NET for awhile now, and without any kind of additional framework.  I create business object classes all the time.  I guess my assumption was, that the business object mapper would show all the tables in a given connection string...and automatically map those to business object I could then interact with.

Is this not the case?  Is there a good example somewhere I can look at? 

I don't mean to be a pain, but we've looked at a LOT of frameworks..and quite frankly I really like the seemless integration of StrataFrame the best..but I need to resolve this to justify it.

Thanks

Nick

By Edhy Rijo - 9/2/2009

Hi Nick,



Did you try Greg's steps?
By powernicholas - 9/2/2009

Edhy Rijo (09/02/2009)
Hi Nick,

Did you try Greg's steps?

my apologies as I misread greg's steps

I interpreted 'add a BO' as me doing what i normally would do by adding a business object and all the insert, update, and delete methods

I didn't realize...if you go to ADD to PROJECT...there was a SF Business Object

I will try the steps right now

thanks!

By Greg McGuffey - 9/2/2009

Ah, that would cause some confusion. BigGrin Once you get the hang of it, BOs make life a lot simpler. Don't hesitate to ask questions if you get stuck/confused.
By powernicholas - 9/2/2009

yeah...so just as an fyi... i'm flying now... this is pretty sweet
By Edhy Rijo - 9/2/2009

powernicholas (09/02/2009)
... i'm flying now... this is pretty sweet




Welcome to the club Tongue and wait until you start using the powerful goodies like the ListView.
By Trent L. Taylor - 9/2/2009

Thanks for all of the help, guys! Good answers and like Edhy said, welcome. Wink