Free counters Added on January 19,2012 Follow Me @vmsdurano A bit About Me Disclaimer The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Contol)Text; it werk just Fine any comment and thx for the code Instead of adding a Customer ID to your table and later pulling the text to get the ID number, a more reliable way to do it is to add a Data Key Names field to the grid example in the page: You can then access this information at any time with the following in code: Grid View1. Row Index]["id"]); You can do this with any field, but I've found customers get confused when they see the ID field and kept asking me why it was there, this also eliminates any issues if you change the display order of your table later (maybe add an edit/update/cancel control) Hey...great article ;)But I got a problem... So here I go with my example:protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) and the debugger says: Exception Details: System. Nor does it represent the opinion of my dog, because I don’t have one. I have a project that I coppied the above code into. Data Keys[Row Index]["Customer ID"]in the Update event it would be something like:int Customer ID = Convert. Format Exception: Input string was not in a correct format. For example, an order-entry application that uses an IDENTITY column for the order ID might need to provide an order-confirmation number to the customer immediately.In such a case, you need a way to retrieve the value of the IDENTITY column and display it in your application. NET lets you retrieve and display this value in a couple of ways.Editor's Note: This article is adapted from Chapter 29 of Michael Otey's book ADO.
However, in some cases, the application or the user needs to know the IDENTITY column's assigned value as soon as you add the row to the database.Dim cust Adapter As Sql Data Adapter = New Sql Data Adapter( _ "SELECT Customer ID, Company Name FROM Customers", connection) ' Add handlers. Row Updating, New Sql Row Updating Event Handler( _ Address Of On Row Updating) Add Handler cust Adapter. Row Updating, _ New Sql Row Updating Event Handler(Address Of On Row Updating) Remove Handler cust Adapter. Row Updated, New Sql Row Updated Event Handler( Address Of On Row Updated) ' Set Data Adapter command properties, fill Data Set, and modify Data Set. Update(cust DS, "Customers") ' Remove handlers. Row Updated, _ New Sql Row Updated Event Handler(Address Of On Row Updated) Private Shared Sub On Row Updating(sender As Object, _ args As Sql Row Updating Event Args) If args. Microsoft is conducting an online survey to understand your opinion of the Technet Web site.If you choose to participate, the online survey will be presented to you when you leave the Technet Web site. In this demo, I presumed that you already have a basic background on how to create a simple database table. Thanks that cmd do not work fine string id = Grid View1.