Error Calling Stored Procedure?

Error Calling Stored Procedure?

Postby rakgol_a » Thu 09 Oct 2008 16:55

Hi,
Platform : PostgreSQLDirect .NET V3.85.33, VS2008 SP1, XP ProSP3

I'me getting a strange error calling SP in C# that table couple boolean and strings parameters. The error I get is
[syntax error at or near "pas"].
PAS is the Postgres schema as per below sp definition
CREATE OR REPLACE FUNCTION pas.sp_addclient(vclientname character varying,
vaccountnumber character varying,
vaddress1 character varying,
vaddress2 character varying,
vaddress3 character varying,
vaddress4 character varying,
vemailaddress character varying,
vtelephone character varying,
vcontactperson character varying,
vclientstatus character varying,
vclienttype character varying,
vurl character varying,
vmustdebit boolean,
vmustcrorrespond boolean,
vnotes text,
vbillingaddress text,
vpostaladdress text)
RETURNS void AS
....

Next is call from C#
cmdProcs.CommandText = "pas.sp_addclient";
cmdProcs.Parameters.Clear();
cmdProcs.ParameterCheck = true;

PgSqlParameter pm1 = new PgSqlParameter();
pm1.Direction = ParameterDirection.Input;
pm1.DbType = DbType.String;
pm1.ParameterName = "vclientname";
pm1.Value = edtClientName.Text;
cmdProcs.Parameters.Add(pm1);
....
PgSqlParameter pm13 = new PgSqlParameter();
pm13.Direction = ParameterDirection.Input;
pm13.DbType = DbType.Boolean;
//pm13.PgSqlType = PgSqlType.Boolean;
pm13.ParameterName = "vmustdebit";
pm13.Value = edtMustDebit.Checked;
....
cmdProcs.Parameters.Add(pm13);

Note: cmfProcs is PgSqlCommand connected to PgSqlConnection


Thanks in advance,
Alfred
rakgol_a
 
Posts: 13
Joined: Wed 17 Oct 2007 13:10

Postby rakgol_a » Fri 10 Oct 2008 17:04

Resolved.

Command had a wrong commandtype... :)

Regards,
Alfred
rakgol_a
 
Posts: 13
Joined: Wed 17 Oct 2007 13:10


Return to dotConnect for PostgreSQL