0
Hi,
Trace the every line of the code...then you can definitely found where is the problem is?
I think the problem is when assigning the value to column name....
value might be null and that column doen't accept the null...
0
Here is my project
When debugging, you access the menu 'File' then 'Connection'.
Login: hammami
Password: aa
You access the menu 'User'and then 'modify user '.
I have the same exeption. Can you help me et thanks in advance for your help.
0
Except I should have looked at the code like Andrew did. I am embarrassed that I did not.
0
I'm with Sam on this one.
You have this code, which is blowing up:
OdbcCommand cmd1 = new OdbcCommand("update utilisateur set login=?,mot_de_passe=?,niveau=? where login=?", cn);
cmd1.Parameters.Add( "mot_de_passe", pass_new.Text);
cmd1 isn't null. So it seems likely that cn or pass_new.Text is null. I don't see the code where these are assigned values, so I can't tell. Only you can tell. You should be able to figure it out as you step through with the debugger.
0
Either cmd1 is not allocated or pass_new is not. When you get the error in the debugger you can see which one is not allocated. It is easy to determine which one is the problem and I think the guys here want you to figure it out. When you determine which one is the problem then you know you can rely on the guys here to eagerly help some more.
0
Thanks for your reply .
the DSN is my machine is valid.What is the object null.The exception starts with the line:"
cmd1.Parameters.Add( "mot_de_passe", pass_new.Text);"
Will you tell me where I must correct in my code and thank you very much.
0
The error indicates you are trying to do something with an object, but the ojbect is null.
You should easily be able to figure out which line the exception occurs on and which object is null just by stepping through the code with the debugger.
Do you know how to set a breakpoint and step through the code line by line? If not, you should have someone demonstrate, because being able to walk through your code line by line and look at all the values is a very basic, very important skill to have.
0
this error usually appears when you use database entities/attributes incorrectly on form. check the database and its entities/attributes with your code-behind. or post the error code?
0
where you're getting the null reference error?
Do you have valid DSN is your machine ?