我使用此代码创建了一个表
CREATE TABLE TABLECATEGORY
(
CATEGORYID NUMBER(10,0) PRIMARY KEY,
CATEGORYNAME VARCHAR2(50 BYTE) NOT NULL ENABLE
)
以及用于选择并加载到网格的此存储过程
create or replace PROCEDURE selectCategory
(c_catid OUT TABLECATEGORY.CATEGORYID%TYPE,
c_catname OUT TABLECATEGORY.CATEGORYNAME%TYPE)
IS
BEGIN
SELECT CATEGORYID,CATEGORYNAME
INTO c_catid, c_catname
FROM TABLECATEGORY ;
END;
我已经使用此C#代码将数据加载到数据网格中
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandText = "selectcategory";
OleDbDataAdapter adp = new OleDbDataAdapter(cmd);
DataTable dt = new DataTable();
adp.Fill(dt);
dataGridView1.DataSource = dt;
当我在Visual Studio中执行程序时,此错误显示在此屏幕快照中: