Dynamic Queries

Discussion in 'ASP .Net' started by Chris, Jan 7, 2007.

  1. Chris

    Chris Guest

    Does anyone know of a way of contructing a query for use in a stored
    procedure programatically without resorting to concatanating lots of strings
    together. I was looking a the linq project but was concerned that it is a
    bit too new/ in development to start using on commercial systems. Any ideas
    would be great.
     
    Chris, Jan 7, 2007
    #1
    1. Advertisements

  2. Constructing a query at runtime for use in a stored procedure?

    What would be the advantage of constructing the procedure
    at run via any mechanism which will ultimately convert it back
    to a string for compilation?

    Stored procedures are meant to be created once and called
    many times. If you are dynamically constructing things,
    why bother with creating a stored procedure of it first
    versus just using dynamic sql?

    Perhaps I'm missing something crucial?

    --
    Robbe Morris - 2004-2006 Microsoft MVP C#
    I've mapped the database to .NET class properties and methods to
    implement an multi-layered object oriented environment for your
    data access layer. Thus, you should rarely ever have to type the words
    SqlCommand, SqlDataAdapter, or SqlConnection again.
    http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
     
    Robbe Morris [C# MVP], Jan 13, 2007
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.