Gettin an error syntax error unexpected token < in json

时间:2017-05-22 07:19:55

标签: javascript jquery json wcf twitter-bootstrap-3

hi I have a code with wcf json format and I'm getting an error "syntax error unexpected token < in json" I dont knowwhat to do please help me, thanks in advance.`public string Update(string details) { string connectionString = GetConnectionString();

        //Details = Details.Replace(',', '.');
        String[] UpdateUserDetails = new String[15];
        // insertUserDetails = Details.Split('~');
        using (OleDbConnection connection1 = new OleDbConnection())
        {
            connection1.ConnectionString = connectionString;
            connection1.Open();

            OleDbCommand command = connection1.CreateCommand();

            //Check user exits
            OleDbCommand cmdcheck = new OleDbCommand();
            cmdcheck.CommandText = "select count(*) from usermaster where Username='" + UpdateUserDetails[0] + "'";
            cmdcheck.Connection = connection1;
            int iReturn = Convert.ToInt16(cmdcheck.ExecuteScalar());
            if (iReturn <= 0)
            {
                string sqlUpdate = "UPDATE usermaster SET UserID= '100', UserName='" +
                 details.Split('~')[0] + "', Password = '" + details.Split('~')[1] + "', FirstName = '" + details.Split('~')[2] + "',LastName = '"
                    + details.Split('~')[3] + "', Email = '" + details.Split('~')[4].Replace('#', '.') + "', MobileNo = '" + details.Split('~')[5] + "', UserType = '"
                    + details.Split('~')[6] + "', UserGroup = '" + details.Split('~')[7] + "', PlantLocation = '" + details.Split('~')[8] + "', Department = '"
                    + details.Split('~')[9] + "', Designation = '" + details.Split('~')[10] + "',Approved = 'No' ";

                OleDbCommand cmdUpdate = new OleDbCommand();
                cmdUpdate.CommandText = sqlUpdate;
                cmdUpdate.Connection = connection1;
                int x = cmdUpdate.ExecuteNonQuery();
                cmdUpdate.Dispose();
                if (x == 1)
                    return "User Updated Successfully";
                else
                    return "User Updation failed";
            }
            else
            {
                return "User Name already exists";
            }
        }
    }`

1 个答案:

答案 0 :(得分:-2)

好吧,你可以尝试使用phyton 3:

示例:

   #!/usr/bin/python3
   import sys

   if len(sys.argv) > 1:
    name = sys.argv[1]
    print("Hello", name)