Обсуждение: Create stored procedure from C#.net

Поиск
Список
Период
Сортировка

Create stored procedure from C#.net

От
postgresuser
Дата:
Hi,
I am using PostgreSql 8.3 version. I want to create stored procedure from
C#.net. Is it possible? Any idea.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Create-stored-procedure-from-C-net-tp5716767.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: Create stored procedure from C#.net

От
Pavel Stehule
Дата:
Hello

2012/7/16 postgresuser <ehsan.hafeez@gmail.com>:
> Hi,
> I am using PostgreSql 8.3 version. I want to create stored procedure from
> C#.net. Is it possible? Any idea.
>

What I know, it is not possible. somebody wrote wrapper for .NET, but
this project was not finished ever

Regards

Pavel Stehule

> --
> View this message in context:
http://postgresql.1045698.n5.nabble.com/Create-stored-procedure-from-C-net-tp5716767.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Re: Create stored procedure from C#.net

От
Brar Piening
Дата:
postgresuser wrote:
> I am using PostgreSql 8.3 version. I want to create stored procedure from
> C#.net. Is it possible? Any idea.

You probably don't mean something like:

using Npgsql;
...
using (NpgsqlConnection connection = new
NpgsqlConnection("Server=127.0.0.1;Database=postgres;Integrated
Security=true;"))
{
     string createFunctionCommand = @"
CREATE OR REPLACE FUNCTION my_cool_function() RETURNS integer AS
$BODY$
select 42;
$BODY$
LANGUAGE sql IMMUTABLE;
";
     NpgsqlCommand command = new NpgsqlCommand(createFunctionCommand,
connection);
     connection.Open();
     command.ExecuteNonQuery();
     connection.Close();
}

Something like PL/C# to write functions in C# doesn't exist.

Regards,

Brar



Re: Create stored procedure from C#.net

От
Chris Travers
Дата:


On Mon, Jul 16, 2012 at 1:29 PM, Brar Piening <brar@gmx.de> wrote:

Something like PL/C# to write functions in C# doesn't exist.


There used to be a PL/Mono, but don't know how well maintained it is.....

Best Wishes,
Chris Travers