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中的寫法。sql

相關文章
相關標籤/搜索