繁体   English   中英

Npgsql.PostgresException 过程未找到异常

[英]Npgsql.PostgresException procedure not found exception

我一直在尝试使用 DataGridView 元素制作一个小的 winform 应用程序。 当我遇到问题时,我一直非常彻底地遵循一个指南。

我试图在我的本地 postgre 服务器上的数据库中插入新行。 我创建了一个程序

CREATE PROCEDURE sp_insertcust(
    aclub_id BIGINT,
    apassport BIGINT,
    aadress TEXT,
    atelephone BIGINT,
    aname TEXT)
    LANGUAGE SQL
AS $$
    INSERT INTO customer (club_id, passport, adress, telephone, name)
    VALUES (aclub_id, apassport, aadress, atelephone, aname)
    RETURNING id $$

但是当我试图在我的 c# 代码中使用它时(ds 是 DataSet) 在此处输入图像描述 我得到了这个例外

Npgsql.PostgresException: "42883:function sp_insertcust(aclub_id => bigint, apassport => bigint, aadress => text, atelephone => text, aname => text) does not exist"

我如何解决它?

我一直在尝试使用 DataGridView 元素制作一个小的 winform 应用程序。 当我遇到问题时,我一直非常彻底地遵循一个指南。

我试图在我的本地 postgre 服务器上的数据库中插入新行。 我创建了一个程序

CREATE PROCEDURE sp_insertcust(
    aclub_id BIGINT,
    apassport BIGINT,
    aadress TEXT,
    atelephone BIGINT,
    aname TEXT)
    LANGUAGE SQL
AS $$
    INSERT INTO customer (club_id, passport, adress, telephone, name)
    VALUES (aclub_id, apassport, aadress, atelephone, aname)
    RETURNING id $$

但是当我试图在我的 c# 代码中使用它时(ds 是 DataSet) 在此处输入图像描述 我得到了这个例外

Npgsql.PostgresException: "42883:function sp_insertcust(aclub_id => bigint, apassport => bigint, aadress => text, atelephone => text, aname => text) does not exist"

我如何解决它?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM