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 8314215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:44:41+00:00 2026-06-08T20:44:41+00:00

I am trying to call a Postgresql stored procedure written in plpgsql using C#

  • 0

I am trying to call a Postgresql stored procedure written in plpgsql using C# and Dapper, but I have found that Dapper alphabetizes the parameters before inserting them into the stored procedure. Is there a way I can avoid this behavior and have the items inserted in the correct order?

For example, the following call would not run correctly because it would alphabetize the parameter names. I have to manually alphabetize them for the call to go through.

int map_id = conn.Query<int>(
"insert_color",
new
{
    zebra_name = new DbString { Value = slide_name },
    door_name = new DbString { Value = fov_name },
    foo_number = cycle_number,
    variable_path = new DbString { Value = image_path },
    random_path = new DbString { Value = meta_path },
    x = x,
    y = y,
    z = z,
    exposure = exposure,
    type_name = new DbString { Value = image_type },
    copy = copy
},
commandType: CommandType.StoredProcedure).First();

Here is the stored procedure declaration:

CREATE OR REPLACE FUNCTION insert_color(
zebra_name text, door_name text, foo_number integer,    
variable_path text, random_path text, 
x real, y real, z real, exposure real,
type_nametext, copy integer) RETURNS integer AS $$
    ...
$$ LANGUAGE plpgsql;
  • 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. Editorial Team
    Editorial Team
    2026-06-08T20:44:43+00:00Added an answer on June 8, 2026 at 8:44 pm

    Internally, Dapper uses reflection to get the properties of the param object. Specifically, GetProperies(...) trouble is, those aren’t guaranteed to be in a particular order…

    The GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.

    In order be somewhat useful, they chose to order the parameters alphabetically, but unfortunately there is no way to ensure that the parameters appear in the order you have them in the class.

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

Sidebar

Related Questions

I'm trying to call a stored procedure using Hibernate, but I'm getting the following
I'm trying to call a PostgreSQL stored procedure from a Java app; the procedure
Im trying to write sample stored functions in postgresql and call them using the
Im trying to call a method that will add or subtract 1 from a
I'm trying to call a WCF service using soap in IE8 and I can't
I am trying to call c# function from javascript the code i have tried
I'm trying to call a movieclip called mcMain that's already on the stage. I'm
I have a Spring application which uses Hibernate on a PostgreSQL database. I'm trying
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
I'm trying to startup my PostgreSQL server on my local machine. But I got

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.