.NET FAQs Unleashed!
Skip Navigation Links
Interview questions on Design Patterns in .NET
ASP.NET Ajax Interview Questions
Interview questions related to security
C# Interview Questions
ASP.NET Interview Questions
Interview Questions in ASP.NET 2.0
Articles at dotnetuncle.com
Skip Navigation Links
OOPs questions in .NET
Questions on .NET Framework
ADO.NET Interview Questions
Short Answer questions in .NET
Frequently asked differences in .NET
Important commonly used Acronyms in .NET
MS SQL, Oracle SQL Interview Questions
 
    
Dotnetuncle's Tip:

  If the XmlReader.MoveToAttribute returns false, it means that the specified attribute does not exist in the current node where the XmlReader object is reading.

    

How do we update and delete data in a gridview? Datakeynames property in .NET?

The best way to Update or Delete a record in a GridView control is to include a CheckBox column and a Submit Button.

The GridView has its own Delete and Edit functionality. If the GridView is populated with data using an SqlDataSource, checkout the wizard that comes along with the SqlDataSource. It may be used to automatically create an SQL Delete command and specify the delete parameters.

The DataKeyNames property of the GridView is set to a field name of the Table.

Follow these links for a detailed understanding of the various ways a GridView record may be updated & deleted.
AspAlliance
EggHeadCafe
ASP.NET QuickStart
MSDN
CodeProject

Bind data to a server control without writing code   Masterpage ContentPage   Nested Masterpage?   SiteMapPath control   Sort GridView   Hotspot class, ImageMap   Update Delete Gridview, Datakeynames  


    
Dotnetuncle's Tip:

  A value type variable cannot be null. For example: int x = null; will throw a compile time error. However, if required, nullable types can be created for value types by using the ? Symbol. Example: int? y = null;