Insert into postgre database from a stored procedure

[email protected]
Newsgroups gmane.comp.db.postgresql.novice
Message-ID <[email protected]>
	


&nbsp;

Hi

I have C#&nbsp; application that uses Dapper as its ORM

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

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

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

in the direction of the documents i should be reading.

my script is shown below

Thanks

Olukay

&nbsp;


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

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

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmd.ExecuteNonQuery();

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; model.Id = p.Get&lt;int&gt;("Id");

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.