Re: Critique my LINQ to SQL strategy using stored procs, please




<dcs@xxxxxxxxx> wrote in message news:249c44ba-7668-44b8-864b-1527ab9b2c5e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
My group is about to embark on building a new ASP.Net web application.
LINQ to SQL seems like a good option for our data access needs, but
I'm not sure I'm using it correctly. I'm hoping someone can critique
my strategy before I get too deep into it.

Here's the scenario:
1. We will be using all stored procedures. No SQL will reside in
the .Net code (company policy)
2. All business logic will reside in the stored procs (company
policy)
3. We expect a total of about 500 stored procs will be created
for this app. The vast majority of these procs will be simple, one-
statement SELECT, INSERT, UPDATE, and DELETE procs.
4. The web app will have moderate use on an intranet by no more
than 10 users.

My strategy:
A. Using LINQ to SQL, create a single LINQ to SQL dbml
B. One-by-one, drag my procs into the designer. No db tables
would be added to the designer
C. Call the stored procs directly from code
D. When filling grids, formviews, etc, use: FormView1.DataSource
= myDataClass.mySelectStoredProc(23); FormView1.Bind();
E. When updating, inserting or deleting, call the proc directly,
as in: TextBox txt = (TextBox)FormView1.FindControl("User_ID");
myDataClass.myDeleteStoredProc(txt.Text);
F. All validation would be done with ASP.Net validation controls

I expect little or no custom code to be written at the data access
level. I have played with this and it appears to work very well. My
question: am I being horribly naive? Are there compelling reasons to
move beyond this simple approach given my all-stored-procs mandate?
Please critique.


Why bother with LINQ-To-SQL? The power is the use of LINQ to work with the virtual database, which using all stored procedures defeats the purpose of using LINQ-To-SQL .

You might as well go with SQL Command object, and data readers, if all that's being used is stored procedures.


.



Relevant Pages

  • Re: LINQ Queries vs Stored Procs
    ... Stored Procedures, you can limit the user to only executing stored ... most sql injection attacks, which are more possible with dynamic sql. ... Also about the security aspects: it's not as you claim it to be: I can ... I as a user in Marketing have to use your app which uses procs and I ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Security level to run SP_OA... Procedures
    ... I'm not sure why you are executing sp_OA* procs here since you can ... sp_OA* procs as well as other master database stored procedures. ... Configure the SQL Agent proxy account. ...
    (microsoft.public.sqlserver.security)
  • Re: basic question
    ... Currently we have are doing calculations via stored procedures ... in which case *I* would like to have them run on the SQL server ... procs are doing. ...
    (microsoft.public.dotnet.general)
  • UDF in LINQ: "Stored Procedures cannot be used inside queries"
    ... I've a question about calling stored procedures in LINQ queries. ... I have some CLR user-defined functions in a SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Critique my LINQ to SQL strategy using stored procs, please
    ... As the main company policy is to build Stored Procedures then why not do that. ... As Linq to SQL gets its power with DataContexts then you can not use that. ... All business logic will reside in the stored procs (company ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast