我得到一个execption作为对象引用未设置为对象的实例。代码如下:

时间:2016-02-19 04:53:58

标签: winforms

FATAL EXCEPTION: main
    02-19 12:45:57.416: E/AndroidRuntime(12465): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.ItemActivity}: java.lang.NullPointerException

1 个答案:

答案 0 :(得分:1)

Ur更新了答案

  public void showdata(string pss, string cipherText)
        {
            SqlConnection conn1 = new SqlConnection(str);


> SqlCommand cmd1 = new SqlCommand("**update Tbl_Users set Password = '" +
> pss + "'where Password ='" + cipherText + "'"**, conn1);

应该是选择参数,而不是更新或投资者参数

 SqlDataAdapter sda1 = new SqlDataAdapter(cmd1);
        Datatable ds1 = new Datatable ();
        sda1.Fill(ds1);
        dataGridView1.DataSource = ds1;
    }