私はプログラミング初心者で、NullReferenceException
エラーが発生しています。何が問題なの?NullReferenceExceptionが処理されませんでした。
DataRow dRow = DS.Tables["tblLogin"].Rows[0];
dRow.BeginEdit();
dRow["PASSWORD"] = txtNew.Text;
dRow.EndEdit();
Cmd = new SqlCommand("Update tblLogin set PASSWORD = @PASSWORD where USERNAME = " + txtUser.Text, sConn);
Cmd.Parameters.Add("@PASSWORD", SqlDbType.VarChar, 50, "PASSWORD");
DA.UpdateCommand = Cmd;
DA.Update(DS, "tblLogin");
MessageBox.Show("Record Updated!", "Payroll System", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
どの行が起こりますか?あなたはtryとcatchを使用することができます.. –
どのコード行ですか? – sll
私はあなたのDataTable "tblLogin"がnullだと思います。 – Khan