Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hai Sir,

I have a Grid view with 8 columns. When I update the specific column in Grid View cell, it is updated but in My Database the remaining all columns shows as NULL values.

How can I rectify this problem? and I want to update only that particular cell and the remaining cells should have old data.
Thanks in Advance..
Posted
Comments
Abhipal Singh 28-May-15 2:30am    
Can you post your Update query?
and some code as well.
Sinisa Hajnal 28-May-15 2:49am    
Please move this into the question via Improve question link. Do NOT post code in comments. Thank you.
Sinisa Hajnal 28-May-15 2:52am    
Also, NEVER use user input directly in your query, use parametrized query or stored procedure. Try entering: " '; DROP student_sub; -- " (without quotes) into sname field and see why you shouldn't. It is called SQL Injection (google it).

Also, consider using String.Format instead of concatenation.

As for this problem: set a breakpoint on String sid = ... and debug from there, you'll see which variable creates problem.
Sergey Alexandrovich Kryukov 28-May-15 2:32am    
Grid view? Which one? Full type name, please.
—SA
Sinisa Hajnal 28-May-15 2:48am    
And add technology tag, is this WPF? Winforms? asp.net? What?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900