StrataFrame Forum

UltraChart business object connection

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

By Michael Reese - 10/1/2007

I am trying to connect to the orders business object with some strange results. I was wondering what is the best way to attach to the business object. Do you have an example?

Michael

By StrataFrame Team - 10/2/2007

Whenever you say "connect" do you mean trying to show the data in a grid?  Or are you trying to connect to the db and retrieve records?  Or are you just trying to retrieve a field value from the business object?  I just need a little more detail on what you're trying to do to point you in the right direction.  Wink  Thanks.
By Michael Reese - 10/2/2007

Hi Ben

I am using UltraChart. I would like to connect to the BO and expose the fields? It is a simple composite chart. Been trying a few ways without success.

Michael

By Trent L. Taylor - 10/2/2007

You will want to drop on a BusinessBindingSOurce on the form, then choose the BO that you want to bind to the grid.  You will then bind to the UltraGrid using their standard DataBindings (DataSource).
By Michael Reese - 10/8/2007

Thanks Guys

The reason I am asking is because I am using ULTRACHART and have the following code to pull back data from 2 tables. Can this be performed with the BBS? Do you have an example. I would like to clean up the form and talk to the BOs directely.

Thanks

Michael

****Chart Sample Code****

Dim ds As New SqlConnection(MicroFour.StrataFrame.Data.DataLayer.DataSources.Item(0).ConnectionString.ToString)

Dim Command2 As SqlCommand = New SqlCommand("SELECT B.SiteName,COUNT(B.ID) AS Sites FROM Subjects A INNER JOIN Sites AS B ON A.SiteID = B.ID GROUP BY B.SiteName", ds)

Dim MainDataAdapterDA2 As New SqlDataAdapter

MainDataAdapterDA2.SelectCommand = Command2

Dim MainDataTable2 As New DataTable

MainDataAdapterDA2.Fill(MainDataTable2)

Dim MainSeries2 As New NumericSeries()

'Databind = Datatable,ValueColumn as String and Label Column as String)

MainSeries2.DataBind(MainDataTable2, "Sites", "SiteName")

By Trent L. Taylor - 10/8/2007

Can this be performed with the BBS?

Sure.  You can create joins, etc. and custom properties and bring back anything that you want (for viewing only).  However....if you want to update a join, then you will need to create a view and make it updatable before it will go both ways.