Thursday, 15 July 2010

c# - TableAdapter Update Fails -


I am trying to update the user password from the tbUsers table in the user password column.

I get the following error when I click on "Confirm Button": Object reference is not set to an instance of an object - NullReferenceException was unused

This It says that I need to install something, but I do not know what is it. I already have the table, the adapter immediately.

Thank you for your help!

  using System.Data; Using System.Data.SqlClient; Using System.IO; Using Library.DataBase.dsLibraryTableAdapters; Using the library. Database; TbUsersTableAdapter table adapter tools = new tbUsersTableAdapter (); DsLibrary.tbUsersDataTable Datatable Tools; Private Zero btnConfirm_Click_1 (Object Sender, RoutedEventArgs e) {tbUsersRow = (dsLibrary.tbUsersRow) dataTableUsers.FindByIdPeopleIdUser (value1, value2); TbUsersRow.userPassword = txtNewPassword.Password.ToString (); & Lt; - Error Table Adapter Here Update (datatable user); }  

OK, this has solved the problem.

Thanks everyone!

  using System.Data; Using System.Data.SqlClient; Using System.IO; Using Library.DataBase.dsLibraryTableAdapters; Using the library. Database; TbUsersTableAdapter table adapter tools = new tbUsersTableAdapter (); DsLibrary.tbUsersDataTable Datatable Tools; Private Zero btnConfirm_Click_1 (Object Sender, RoutedEventArgs e) {dataTableUsers = tableAdapterUsers.getDataByUserName (lblUser.Content.ToString ()); TbUsersRow = (dsLibrary.tbUsersRow) datatable user Raoz [0]; TbUsersRow.userPassword = txtNewPassword.Password.ToString (); TableAdapterUsers.Update (dataTableUsers); }  

No comments:

Post a Comment