问题描述
stringzsname="买东西";//真实姓名stringsex="男";//性别DateTimebirthdy=newDateTime(1990,2,12);//生日intphone=0;//手机号码decimaltotal=0;//积分decimalsurplusinte=0;//剩余积分intIsuse=0;//是否可用0正常1锁定DateTimeendlogintime=newDateTime();//最后一次登录时间stringendloginIP=Request.UserHostAddress;//最一次登录IPintlgoinnum=1;//登录次数;DateTimenow=DateTime.Now;//注册时间stringtime=now.Year.ToString().Trim()+"-"+now.Month.ToString().Trim()+"-"+now.Day.ToString().Trim()+""+now.Hour.ToString().Trim()+":"+now.Minute.ToString()+":"+now.Second.ToString();stringsql="insertintouserinfovalues(gai_web.nextval,'"+(Request.Form["name"].Trim()).ToString()+"','"+(Request.Form["pwd"].Trim()).ToString()+"','"+zsname+"','"+sex+"','"+time+"',"+phone+",'"+time+"','"+(Request.Form["email"].Trim()).ToString()+"',"+total+","+surplusinte+","+Isuse+",'"+time+"','"+endloginIP+"',"+lgoinnum+")";inti=OraDBHelper.ExecuteScalar(sql);提示报错误:ORA-01861:文字与格式字符串不匹配存入ORACLE数据库的不知错在那?
解决方案
解决方案二:
输出你的sql语句可能有问题
解决方案三:
inti=OraDBHelper.ExecuteScalar(sql);这里打个断点,把sql取出来跑一下