C# 向ORACLE数据库添加信息 ,代码报错‘无效字符’, 大家帮忙看看啊
stringdemoConnStr='darasource=(local);userid=demo;password=demo";OracleConnectionconn...
string demoConnStr='dara source=(local);user id=demo;password=demo";
OracleConnection conn=new OracleConnection();
conn.ConnectionString=demoConnStr;
conn.Open();
OracleCommand comm=new OracleCommand();
comm.Connection=conn;
comm.CommandText="insert into demotable (democolumn,demodate) values (:democolumn,:demodate);";
comm.Parameters.Add("democolumn",OracleType.VarChar,20);
comm.Parameters["democolumn"].Value="测试";
comm.Parameters.Add("demodate",OracleType.DateTime);
comm.Parameters["demodate"].Value=DateTime.Now;
comm.ExecuteNonQuery();
conn.Close();
代码类似上面 大家帮忙看看哪里有错。。 谢谢 展开
OracleConnection conn=new OracleConnection();
conn.ConnectionString=demoConnStr;
conn.Open();
OracleCommand comm=new OracleCommand();
comm.Connection=conn;
comm.CommandText="insert into demotable (democolumn,demodate) values (:democolumn,:demodate);";
comm.Parameters.Add("democolumn",OracleType.VarChar,20);
comm.Parameters["democolumn"].Value="测试";
comm.Parameters.Add("demodate",OracleType.DateTime);
comm.Parameters["demodate"].Value=DateTime.Now;
comm.ExecuteNonQuery();
conn.Close();
代码类似上面 大家帮忙看看哪里有错。。 谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询