Best Way To Handle Data Relations

C

corey.burnett

I am writing an ASP.NET application that uses SalesForce data as the
back end. SalesForce has a web service that exposes the data in their
system. Unfortunately the ways that you can select data are very
rudimentary. There is no way to do a join between tables in SalesForce
and there is no way to sort data in SalesForce. You also can't do many
of the other options in SQL like Unique, etc. Basically you can select
data from one table at a time and you can use very basic WHERE clauses
and that's about it.

So my plan was to select data from SalesForce and populate an ADO.NET
DataTable. If I needed to sort the data I would create a DataView that
would sort properly. If I needed to do a join then I would put
multiple DataTables in to a DataSet and manually add DataRelations.

Am I going in the right direction? This seems so, so cumbersome and of
course the performance stinks. I have warned the client about this
from the beginning but this project is sort of a "proof of concept" to
see if it can be done.

I'm just getting lost a bit in all of the different ADO.NET objects
that are out there and I haven't been able to find a good example
anywhere that shows me how you can take data from individual tables and
add relationships and sort, etc. Can anyone point me to a good example
that shows how this is done? Or if there is a completely better way to
approach this?

Thanks,
Corey
 
C

corey.burnett

Maybe a better way to ask the question is this...

I'm trying to write an ASP.NET application that connects to a back end
database through a web service. The back end database does not support
joins of any kind or sorting of any kind. My application will need to
have sorting and need to join data from certain tables (and sort the
joined data).

What would be the best way to do this? (datasets? datarelations?,
etc.)

Thanks,
Corey
 
C

Cor Ligthert [MVP]

Corey,

I think it is your only alternative, however I hope that they support a
kind of "Where" clauses.

For the rest I don't see the problem why not do it this way.

I have seen on these dotnet boards that you are not they only one, moreover
it is for most people I have seen a prefered method above a Join on the
serverside.

(You have much more trouble updating a joined table with AdoNet)

I hope this gives an idea.

Cor
 
C

corey.burnett

Cor said:
Corey,

I think it is your only alternative, however I hope that they support a
kind of "Where" clauses.

For the rest I don't see the problem why not do it this way.

I have seen on these dotnet boards that you are not they only one, moreover
it is for most people I have seen a prefered method above a Join on the
serverside.

(You have much more trouble updating a joined table with AdoNet)

I hope this gives an idea.

Cor

Yes, they do support "where" clauses.

Ok, so if this is the best way to handle this, then my question is
this...

Let's say I have the following situation. I have a DataTable called
Customers. And I have a DataTable called Orders. And I have a
DataTable called OrderItems. And I have added a DataRelation between
Customers and Orders and between Orders and OrderItems. Now I want to
present a DataGrid on my web page that has the following columns:
CustomerName (from Customer table), Order ID (from Order table),
OrderDate (from Order table), Item Name (from OrderItems), Quantity
(from OrderItems). And I want the grid to be sorted by CustomerName,
then by OrderDate, then by Item Name. Can someone explain the steps to
do that?

(Remember that my back end database does not support joins or sorting.
So I have to get each DataTable one at a time)

Thanks,
Corey
 
C

Cor Ligthert [MVP]

Corey,

So direct withouth knowing what you want to update do I think that in the
way you ask it, that I would make from all those tables one datatable (based
on the lowest item you want to show) and than show it in a gridview on your
webpage using paging.

However probably would I not do that and create some labels on a higher
level as customer and order to make it for the client easier to use.

Just my thought,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top