Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why I prefer stored procs
Message
De
22/06/2007 09:55:50
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01232867
Message ID:
01235002
Vues:
26
If you have any issues or questions, the .NET forum on here is pretty darn good IMO.

>Thanks Mike, well it make sense to me now, I can remember a bit, we use to start our Insurance project using VB.NET 2005 and Firebird. And I opened that project and yes, your right, can set to use SP.
>
>Regards.
>
>>First of all, I haven't done much serious development using Datasets, so I might not be the best person to answer this question. I usually use custom classes. I do maintain some code though, so I will try to answer as best as I can.
>>
>>The datasets themselves don't perform data connectivity. I know in 2005 they have TableAdapters that are stored right with the Strongly-Typed datasets, but I haven't used them very much. For SELECT statements, I create a SQLDataAdapter, set my SPROC name as the CommandText, set CommandType to StoredProcedure, and fill my Dataset. For other statements, I just use a SQLCommand and configure it accordingly.
>>
>>>Hi Mike,
>>>
>>>In Delphi Dataset, IBDataset has DeleteSQL, SelectSQL, ModifySQL, InsertSQL, RefreshSQL Properties but I don't know how to configure a dataset to use SP.
>>>
>>>Is VS2005 has this capability? e.g. DataSet configure to use SP? Can you show me step by step please?
>>>
>>>I have VS2005 and SQL 2005 Developer Edition on my laptop, so there will be no problem for me to implement what you had mentioned. I want to learn how to configure a VS2005 DataSet to use SP.
>>>
>>>
>>>Thanks.
>>>
>>>>No, I know what you mean. The datasets need SOME method to perform CRUD operations. You can configure a dataset to use straight SQL statements, or you can configure them to use SPs. I think that the preferred method of a lot of people is to use SPs and datasets.
>>>>
>>>>>Hi Mike,
>>>>>
>>>>>Thanks but I know that, I think I didn't make myself clear here. Few months ago, some people are saying to me that its better to use dataset in Inserting, Updating, deleting data instead of using SP.
>>>>>
>>>>>
>>>>>
>>>>>>SP's are on the database end and provide the data. Datasets are the containers or classes in the application that hold the data.
>>>>>>
>>>>>>>Hi Kevin,
>>>>>>>
>>>>>>>I'm quite happy that you have this blog "Why I prefer stored procs". Does this means that you prepare using SP rather than DATASET now?
>>>>>>>
>>>>>>>I still remember few months ago, some people here are saying that its better to use DATASET than SP.
>>>>>>>
>>>>>>>Regards
>>>>>>>
>>>>>>>>I'm gonna put this in my blog....basically, in no order of importance:
>>>>>>>>
>>>>>>>>- They provide an application/client-agnostic API for accessing the database.
>>>>>>>>
>>>>>>>>- Having an application-agnostic API for the database can really become beneficial in a corporate environment with several applications and developer teams.
>>>>>>>>
>>>>>>>>- If I had a dime for every time an I.T. manager breathed a sigh of relief when I told him/her that something could be added/changed/fixed simply by tweaking a stored proc (as opposed to having to update an application DLL), I'd have plenty of dimes.
>>>>>>>>
>>>>>>>>- I can abstract out and establish an API and build stored procs independantly of the application, and in many instances can make changes without disrupting the development environment
>>>>>>>>
>>>>>>>>- The new tools for building custom database unit tests in Visual Studio Team Edition for Database Professionals are outstanding. (If anyone is interested in building unit tests for stored procs, you HAVE to look at this product. It is fantastic).
>>>>>>>>
>>>>>>>>- It's much more difficult for a DBA to manage database code if it's residing inside application logic
>>>>>>>>
>>>>>>>>- SQL 2005 contains many new language features that are best utilized inside stored procs.
>>>>>>>>
>>>>>>>>
>>>>>>>>As I've said before, I use them as a strong starting point, unless there are good reasons for not doing so. In general, I believe that all external access to a database should occur through stored procs.
>>>>>>>>
>>>>>>>>Clients WANT me to use stored procs. I work with at least a few new I.T. teams each year, and I can't think of one that didn't want to use them. And when the ultimate decision is left to me, I use them on a regular basis.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform