简体   繁体   English

我正在尝试将数据输入parse.com中的custmom列,但出现错误

[英]I am trying to enter data to a custmom column in parse.com ,but I am getting an error

I have made a user table that looks as which includes a custom Name field . 我制作了一个用户表,该表看起来包含一个自定义“名称”字段。

Now whenever I try to put data into this field i get an error . 现在,每当我尝试将数据放入此字段时,都会出现错误。

The code i Used was . 我使用的代码是。

ParseUser user = new ParseUser();
                user.setUsername(Name);
                user.setPassword(Password);
                user.setEmail("nevin.george.sunny@gmail.com");


                user.put("Name","test");

                user.signUpInBackground(new SignUpCallback() {
                    @Override
                    public void done(ParseException e) {
                        if (e == null) {
                            // Show a simple Toast message upon successful registration
                            Toast.makeText(getApplicationContext(),
                                    "Successfully Signed up, please log in.",
                                    Toast.LENGTH_LONG).show();
                        } else {
                            Toast.makeText(getApplicationContext(),
                                    "Sign up Error", Toast.LENGTH_LONG)
                                    .show();
                        }
                    }


                });

But I get the "Sign Up error" Message Displayed .And no updates in the table . 但是我收到显示的“注册错误”消息。表中没有更新。

The Code below has worked for me on numerous projects (so thought I would paste in case it helped). 下面的代码在许多项目上为我工作(所以我认为如果有帮助,我会粘贴)。 Where are you getting your 'setusername' and 'setpassword' from? 您从哪里获得“ setusername”和“ setpassword”?

  public void register(final View v){
    if(mUsernameField.getText().length() == 0 || mPasswordField.getText().length() == 0)
        return;

    v.setEnabled(false);
    ParseUser user = new ParseUser();
    user.setUsername(mUsernameField.getText().toString());
    user.setPassword(mPasswordField.getText().toString());
    //mErrorField.setText("");

    user.signUpInBackground(new SignUpCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                Intent intent = new Intent(RegisterActivity.this, LoggedIn.class);
                startActivity(intent);
                finish();
            } else {
                // Sign up didn't succeed. Look at the ParseException
                // to figure out what went wrong
                switch(e.getCode()){
                    case ParseException.USERNAME_TAKEN:
                        mErrorField.setText("Sorry, this username has already been taken.");
                        break;
                    case ParseException.USERNAME_MISSING:
                        mErrorField.setText("Sorry, you must supply a username to register.");
                        break;
                    case ParseException.PASSWORD_MISSING:
                        mErrorField.setText("Sorry, you must supply a password to register.");
                        break;
                    default:
                        mErrorField.setText(e.getLocalizedMessage());
                }
                v.setEnabled(true);
            }
        }
    });
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试使用firebase和android将数据输入数据库中,但是数据没有被馈入数据库中 - I am trying to enter data into the database using firebase and android but data is not getting fed into the database 我正在尝试启动 Mozilla,但仍然收到此错误 - I am trying to launch Mozilla but still I am getting this error 尝试从 MySql 中的数据库检索数据时出现“java.lang.ClassNotFoundException: com.mysql.jdbc.Driver”错误 - I am getting " java.lang.ClassNotFoundException: com.mysql.jdbc.Driver " error while trying to retrieve data from the database in MySql Parse.com:使用parseUser,如何在我从类中解析创建的列中保存数据? - Parse.com: with parseUser, how can I save data in a column I created in parse from the class? 我在 CMD 中收到此错误,但它在 intellij 中正常工作。当我输入数据 3 次时会发生这种情况 - I am getting this error in CMD but its working correctly in intellij.It happens when i enter data 3 times 尝试 setOnClickListener 时出现错误 - I am getting error when trying to setOnClickListener 当我尝试解析实际日期时出现错误的日期 - Getting wrong date when I am trying to parse actual date 我正在尝试从 Excel 表中获取数据并将这些测试数据传递到登录和密码字段中,但出现以下错误 - I am trying to get data from excel sheet and pass those test data into the login & password field but I am getting following error 如何使用parse.com发送和检索数据 - How can I send and retrieve data with parse.com 我正在尝试使用JSON格式显示来自MySQL数据库的数据,但我一直收到以下错误 - I am trying to display data from MySQL database using JSON Format but i keep getting the following error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM