w=150 150w, https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=300 300w" sizes="(max-width: 416px) 100vw, 416px" /Event. If we move our mouse on to the variables, which hold the cell values, we can see the old value instead of new updated value (Refer the debugging Screen Shot at the Top).
Row Updating Dim f File Attachment As File Upload = CType(Me. To save the file you need to use the File Upload control’s Save As method. Get All Bytes to get its image bytes and assign it to the Sql Data Source (Update Command). The following is an example of a Sql Data Source control where an Image parameter is added, and where the Select- and Update Command are specified (The Image parameter represents the filename that will be passed to the Update Commnad): " ID="Sql Data Source1" runat="server" Select Command="SELECT [Customer ID], [Name], [Image] FROM [Customers]" Update Command="UPDATE [Customers] SET [Name] = @Name, [Image] = @Image WHERE [Customer ID] = @original_Customer ID" The File Upload control, will not automatically save the uploaded file. I think you should put an File Uploder into the Grid View, and say that you should get the specific file through its text, and use File.tbl Set Marks: Class, Section, Admission No, Subject ID, Subject Code, Max Marks, Marks I want to update marks inside gridview using edit command button.when I update the record It performs updation on the above row instead of desired row. Save As(path) End If End Sub Hi try this example: To add a File Upload control to your Grid View, you first need to add an Item Template Field.
When you have the instance of the Gird View’s row, you can use the Find Control method to locate the File Upload control. Find Control("new File"), File Upload) Dim old File As label = CType(Noticias. I have a second grid in which I used the code below to obtain the row that has been updated.This, however, doesn't work because my grid has a composite Key Field Name (because the table it's based on has a primary key made up of two columns).This results in the Find Visible Index By Key Value method always returning -1.Any ideas on how I could obtain the row some other way? If you only want to show the File Upload control when a row has entered edit mode, you can add the File Upload ot the Edit Item Template: As you can see in the code above, the Item Tempalte will display an Image control, where the Image Url attribute of the control is bound to a “Image” field (The “Image” in this case is the name of the data source’s column that will contain the path to the image that should be displayed).