Anyone have an example of calling a stored procedure in PostgreSQL from ASP.NET(1.1 C#), or can help me figure out what I'm doing wrong?...
I'm using "PostgreSQLDirect .NET Standard for .NET Framework 1.x (version 2.40.13)"
Here is the Stored procedure I created.
Code: Select all
CREATE OR REPLACE FUNCTION "CMRC_SP_SetNewOrder"()
RETURNS void AS
begin
SELECT COUNT( DISTINCT CMRC_Orders.OrderID ) AS scount, CMRC_OrderStatus.StatusName, CMRC_OrderStatus.StatusID FROM CMRC_Orders INNER JOIN CMRC_OrderStatus ON CMRC_Orders.OrderStatus = CMRC_OrderStatus.StatusID LEFT OUTER JOIN CMRC_OrderDetails ON CMRC_Orders.OrderID = CMRC_OrderDetails.OrderID WHERE ( CMRC_Orders.OrderStatus = 1 ) GROUP BY CMRC_OrderStatus.StatusName, CMRC_OrderStatus.StatusID;
End;
LANGUAGE 'plpgsql';
Here is the code (ASP.NET 1.1 C#)
Code: Select all
public PgSqlDataReader setNewOrder()
{
// Create Instance of Connection and Command Object
PgSqlConnection pgSqlConnection1 = new PgSqlConnection( ConfigurationSettings.AppSettings["ConnectionString"] );
pgSqlConnection1.Open ();
CoreLab.PostgreSql.PgSqlCommand Cmd = new CoreLab.PostgreSql.PgSqlCommand( "CMRC_SP_SetNewOrder", pgSqlConnection1 );
// Mark the Command as a SPROC
Cmd.CommandType = CommandType.StoredProcedure;
// Return the datareader result
return Cmd.ExecuteReader( CommandBehavior.CloseConnection );
}
CoreLab.PostgreSql.PgSqlException: function cmrc_sp_setneworder() does not exist...
Any help or direction would be a great help...
thanks