Oracle.ManagedDataAccess.Client.OracleException:“ORA-00936: 缺失表达式”

static void Main(string[] args)
        {

            string sql = "insert into StudentC(Stuid, Stuname, Stupass) values(@Stuid,@Stuname,@Stupass)";
            OracleParameter[] parameters =
            {
                new OracleParameter("@Stuid",OracleDbType.Int32,2),
                new OracleParameter("@Stuname",OracleDbType.Varchar2,20),
                new OracleParameter("@Stupass",OracleDbType.Varchar2,20)
            };
            parameters[0].Value = 3;
            parameters[1].Value = "疯了";
            parameters[2].Value = "studen";
            Db_Helper_DG.ExecuteNonQuery(sql, CommandType.Text,parameters);

        }

这是我最开始写的代码,讲@符号换成:,因为@符号是sqlserver中的写法。

posted @ 2018-12-19 11:49  冯六万  阅读(4858)  评论(3编辑  收藏  举报