Insert into postgre database from a stored procedure - Mailing list pgsql-novice

From techsupport@datatronicsnig.com
Subject Insert into postgre database from a stored procedure
Date
Msg-id 201812030234.wB32Yf7e031794@mail549c25.carrierzone.com
Whole thread Raw
Responses Re: Insert into postgre database from a stored procedure
List pgsql-novice
  Hi

I have C#  application that uses Dapper as its ORM

I am trying insert  records into a postgresql database through a stored procedure

I get a syntax error on  cmd.ExecuteNonQuery();  line

Can you please mail me some documents to help me solve the problem or point me 

in the direction of the documents i should be reading.

my script is shown below

Thanks

Olukay

 


  NpgsqlConnection conn = new NpgsqlConnection("Host = 127.0.0.1; Database = Tournaments; Port = 5432; Username = postgres; Password = manager");
            conn.Open();
                                 
            {
                NpgsqlCommand cmd = new NpgsqlCommand("public.spabsecode_insert", conn);
                var p = new DynamicParameters();

                cmd.Parameters.Add(new NpgsqlParameter("absecodex", model.Absecode));
                cmd.Parameters.Add(new NpgsqlParameter("absedescx", model.Absedesc));

                cmd.ExecuteNonQuery();

                model.Id = p.Get<int>("Id");

            }
        }

pgsql-novice by date:

Previous
From: jbullock
Date:
Subject: I'm late, but yeah, default to postgreSQL -- Re: Choice of DB
Next
From: Lutz Horn
Date:
Subject: Re: Insert into postgre database from a stored procedure