Tags: advice, arguement, datatable, gurus, orderid, orders, programming, project, sql, working

OrderID or DataTable

On Programmer » SQL

2,522 words with 1 Comments; publish: Wed, 28 May 2008 23:58:00 GMT; (20046.88, « »)

Hi Gurus,

I need advice from you. We are going through an arguement.

I am working on a [ORDERS] project, and another person is working on

[REPORTING].

What he want me to pass is a OrderID, then he will do a query, create a

DataTable to create a report.

But the question is should I pass a OrderID, or a DataTable which I already

have before I call the report.

I peronally don't want to do any query or any round trip to database if I

already have the data.

The other programmer don't think I am right. He want to keep his project

simple and clean.

I just want your suggestion, that what is right solution for this.

Should I pass DataTable or OrderID.

Thanks for any help you can provide.

We are using DotNet Framework 2.0

Thanks, Tim

All Comments

Leave a comment...

  • 1 Comments
    • On 9 Apr, 16:25, "Tim" <Tim.sql.todaysummary.com.noemailcom> wrote:

      > Hi Gurus,

      > I need advice from you. We are going through an arguement.

      > I am working on a [ORDERS] project, and another person is working on

      > [REPORTING].

      > What he want me to pass is a OrderID, then he will do a query, create a

      > DataTable to create a report.

      > But the question is should I pass a OrderID, or a DataTable which I already

      > have before I call the report.

      > I peronally don't want to do any query or any round trip to database if I

      > already have the data.

      > The other programmer don't think I am right. He want to keep his project

      > simple and clean.

      > I just want your suggestion, that what is right solution for this.

      > Should I pass DataTable or OrderID.

      > Thanks for any help you can provide.

      > We are using DotNet Framework 2.0

      > Thanks, Tim

      On the principle of loose coupling it seems like the preferred

      approach would be to pass a parameter OrderID rather than a DataTable

      object.

      This isn't really a SQL Server question. Best to ask in a .NET related

      forum if you want a more considered evaluation.

      --

      David Portas, SQL Server MVP

      Whenever possible please post enough code to reproduce your problem.

      Including CREATE TABLE and INSERT statements usually helps.

      State what version of SQL Server you are using and specify the content

      of any error messages.

      SQL Server Books Online:

      http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx

      --

      #1; Wed, 28 May 2008 23:59:00 GMT