更新查询不起作用。始终捕获语法正在运行

时间:2016-08-29 08:47:07

标签: mysql sql sql-server razor

我想更新记录。但每次我试图更新。它去捕捉声明。我无法找到我的查询语法无效的地方。

总是去捕捉声明

我不知道查询是错误的还是语法中有任何错误。

NSMutableArray *sourceList = self.questions;
NSMutableArray *randomizedList;

for (NSInteger i = sourceList.count; i > 0; i--) {
    //other things

    [randomizedList addObject:sourceList[index]];
    [sourceList removeObject:sourceList[index]];
}

1 个答案:

答案 0 :(得分:1)

           var updateCommand = "Update site_data_table set Student_Reg_No =@0, Student_Name=@1, Father_Name=@2, Temporary_Address=@3,Permanent_Address=@4, Phone_No=@5, Blood_Group=@6, Email_Address=@7 where Id=@8)";

更改为

       var updateCommand = "Update site_data_table set Student_Reg_No =@0, Student_Name=@1, Father_Name=@2, Temporary_Address=@3,Permanent_Address=@4, Phone_No=@5, Blood_Group=@6, Email_Address=@7 where Id=@8";