Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 180851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:39:32+00:00 2026-05-11T14:39:32+00:00

I’m trying to standardise some data access code with my colleagues. One of the

  • 0

I’m trying to standardise some data access code with my colleagues. One of the aforementioned colleagues asserts that the EntLib Data Access Block trys to cache parameters on stored proc calls.

I’ve had a look in reflector and there is some evidence that it could be caching them. But I don’t think it does in the following situation.

    public Dictionary<long, string> GetQueue(int maxItems)     {         var sq = new SqlDatabase(_connString.ConnectionString);          var result = new Dictionary<long, string>();          using (var cmd = (SqlCommand)sq.GetStoredProcCommand('dbo.GetQueue'))         {             sq.AddInParameter(cmd, 'maxItems', DbType.Int32, maxItems);              var reader =  cmd.ExecuteReader(CommandBehavior.CloseConnection);              while (reader.Read())             {                 long id = reader.GetInt64(reader.GetOrdinal('id'));                 string fileName = reader.GetString(reader.GetOrdinal('meta_data_filename'));                  result.Add(id, fileName);             }         }          return result;     } 

Can anyone confirm or deny this?

I’m using EntLib 4.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:39:32+00:00Added an answer on May 11, 2026 at 2:39 pm

    It definetly used to, I ripped the code out and threw in in my library.

    it used sp_help and parsed the output to determine the data types.

    These days, I ripped the code out, .Net is much much better about adding parameters.

    cmd.Parameters.AddWithValue('@name',somevalue) 

    in your example of you keep reflectoring … you will find it being done down this path GetStoredProcCommand()

    You will get a Command object back, already populated with parameters

    The ent lib code is copyrighted, but the code is almost identical to this

    http://code.google.com/p/dbdotnet/source/browse/trunk/ParameterCache.cs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.