|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OrderID or DataTableI 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 It really depends on how your partner is building the report. If he's using
Reporting Services, it makes sense to send him the OrderID as the query is built into the report definition--the Reporting Services engine will rerun the query. If he's using the ReportViewer control, then passing a populated DataTable makes sense as this is what the ReportViewer control expects. hth See Chapter 14. -- Show quoteHide quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Tim" <Tim@noemailcom> wrote in message news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... > 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 > > > > We are not using any Reporting Services. We both are using the same Query to
populate the dataTable. Report will have the same data which I have in DataTable when I call the report. Thanks, Tim Show quoteHide quote "William (Bill) Vaughn" <billvaRemoveT***@betav.com> wrote in message news:u2F$NO4eHHA.4176@TK2MSFTNGP03.phx.gbl... > It really depends on how your partner is building the report. If he's > using Reporting Services, it makes sense to send him the OrderID as the > query is built into the report definition--the Reporting Services engine > will rerun the query. If he's using the ReportViewer control, then passing > a populated DataTable makes sense as this is what the ReportViewer control > expects. > > hth > See Chapter 14. > > -- > ____________________________________ > William (Bill) Vaughn > Author, Mentor, Consultant > Microsoft MVP > INETA Speaker > www.betav.com/blog/billva > www.betav.com > Please reply only to the newsgroup so that others can benefit. > This posting is provided "AS IS" with no warranties, and confers no > rights. > __________________________________ > Visit www.hitchhikerguides.net to get more information on my latest book: > Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) > and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) > ----------------------------------------------------------------------------------------------------------------------- > > "Tim" <Tim@noemailcom> wrote in message > news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... >> 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 >> >> >> >> > > You should pass in "orderID" to keep the system simple in most cases.
The benefits are: 1. The report can be run from other places without depending on your application (web or Windows). 2. If you ever need to change your application and/or the reports, you do not need to change both or risk of breaking the application and/or the reports. 3. You might want to put the logic into stored procedures so that you can use them from both the "reporting" and "orders". Charles Zhang http://www.speedydb.com (SpeedyDB ADO.NET Provider) Tim wrote: Show quoteHide quote > We are not using any Reporting Services. We both are using the same Query to > populate the dataTable. > Report will have the same data which I have in DataTable when I call the > report. > > Thanks, Tim > > "William (Bill) Vaughn" <billvaRemoveT***@betav.com> wrote in message > news:u2F$NO4eHHA.4176@TK2MSFTNGP03.phx.gbl... >> It really depends on how your partner is building the report. If he's >> using Reporting Services, it makes sense to send him the OrderID as the >> query is built into the report definition--the Reporting Services engine >> will rerun the query. If he's using the ReportViewer control, then passing >> a populated DataTable makes sense as this is what the ReportViewer control >> expects. >> >> hth >> See Chapter 14. >> >> -- >> ____________________________________ >> William (Bill) Vaughn >> Author, Mentor, Consultant >> Microsoft MVP >> INETA Speaker >> www.betav.com/blog/billva >> www.betav.com >> Please reply only to the newsgroup so that others can benefit. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> __________________________________ >> Visit www.hitchhikerguides.net to get more information on my latest book: >> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) >> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) >> ----------------------------------------------------------------------------------------------------------------------- >> >> "Tim" <Tim@noemailcom> wrote in message >> news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> >>> >>> >> > > You should pass in "orderID" to keep the system simple in most cases.
The benefits are: 1. The report can be run from other places without depending on your application (web or Windows). 2. If you ever need to change your application and/or the reports, you do not need to change both or risk of breaking the application and/or the reports. 3. You might want to put the logic into stored procedures so that you can use them from both the "reporting" and "orders". Charles Zhang http://www.sp Tim wrote: Show quoteHide quote > We are not using any Reporting Services. We both are using the same Query to > populate the dataTable. > Report will have the same data which I have in DataTable when I call the > report. > > Thanks, Tim > > "William (Bill) Vaughn" <billvaRemoveT***@betav.com> wrote in message > news:u2F$NO4eHHA.4176@TK2MSFTNGP03.phx.gbl... >> It really depends on how your partner is building the report. If he's >> using Reporting Services, it makes sense to send him the OrderID as the >> query is built into the report definition--the Reporting Services engine >> will rerun the query. If he's using the ReportViewer control, then passing >> a populated DataTable makes sense as this is what the ReportViewer control >> expects. >> >> hth >> See Chapter 14. >> >> -- >> ____________________________________ >> William (Bill) Vaughn >> Author, Mentor, Consultant >> Microsoft MVP >> INETA Speaker >> www.betav.com/blog/billva >> www.betav.com >> Please reply only to the newsgroup so that others can benefit. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> __________________________________ >> Visit www.hitchhikerguides.net to get more information on my latest book: >> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) >> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) >> ----------------------------------------------------------------------------------------------------------------------- >> >> "Tim" <Tim@noemailcom> wrote in message >> news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> >>> >>> >> > > Why not have him create an extra constructor and simply pass both? He can
then do what he wants with either. Show quoteHide quote "Tim" <Tim@noemailcom> wrote in message news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... > 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 > > > > Hi Tim,
You can send a serialized datatable to him. However what do you think would that make sense if you can get it by a transact SQL procedure from the database server, which goes probably with the same speed. Cor Show quoteHide quote "Tim" <Tim@noemailcom> schreef in bericht news:%23srHfa3eHHA.3632@TK2MSFTNGP02.phx.gbl... > 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 > > > > Tim,
From experience I can tell you, unless your DB server is running a Pentium II, you should absolutely send him the order id. The reason is, by sending him only what you think should be sent now, you put him in a box and he might as well let you do everything and go home. Sending him the Order ID gives him the flexibility to be innovative now and later. While your data table may suit his needs today (well, actually, the needs of the users and the business, which should always be our focus), it may not tomorrow and he will have to return to you, the daddy, the owner, to beg and plead and use up your valuable time changing this data table while not breaking your app, testing etc. should his users needs ever change. Give him the Order ID as well as the ability to create stored procs on the DBMS and you will save yourself a lot of time later. What users need in applications do not always match what they may need to add to a report like, say, data from another source (inventory data, customer info that wasn’t thought of before but that is not needed in the actual app, etc.). I hope this helps.
Other interesting topics
Currency Manager
copying an object by value Multiple relation in dataset. Increase Connection\ Command timeout globally Getchanges problem on expression column using an xml file to store a pre-connection value--- client-server app where data is disconnected, but stays fresh Concurrency Problem: Two separate dynamic SQL queries. SqlCommandBuilder.DeriveParameters not working for CLR Stored Procedure. ADO.NET Abstraction Layer: Basic SQL building blocks? |
|||||||||||||||||||||||