string OleDb = "INSERT INTO [User]([UserName],[UserLoginID],[UserLoginPassword],[Sex],[Organization],[Address],[Telphone],[Email],[Business],[Photo]) VALUES('@UserName','@UserLoginID','@UserLoginPassword','@Sex','@Organization','@Address','@Telphone','@Email','@Business','@Photo')"; try { OleDbParameter[] para = new OleDbParameter[] { new OleDbParameter("@UserName",user.UserName), new OleDbParameter("@UserLoginID",user.UserLoginID), new OleDbParameter("@UserLoginPassword",user.UserLoginPassword), new OleDbParameter("@Sex",user.Sex), new OleDbParameter("@Organization",user.Organization), new OleDbParameter("@Address",user.Address), new OleDbParameter("@Telphone",user.Telphone), new OleDbParameter("@Email",user.Email), new OleDbParameter("@Business",user.Business), new OleDbParameter("@Photo",user.Photo), };
int i=DBHelper.ExecuteCommand(OleDb, para);
return i == 1 ? true : false; } catch (Exception e) { Console.WriteLine(e.Message); throw e; }
System.Data.OleDb.OleDbException: 查询值的数目与目标字段中的数目不同。
添加回答
举报
0/150
提交
取消