Asp net detailsview itemupdating e newvalues

However it seems that if the value coming from the Details View is null for Field1 then e. Is there an easy way round this, i am putting the values of about 10 fields into one string variable, i want to avoid 10 if (e. = null) If you just want to avoid duplicated code, why not move it into another method?

As when I assign updated Name to Label1 it displays the old product name value and not the one in the textbox.But I can't see why it wouldn't be bringing back the new textbox values.Ok, Now I'm sure this was working the other day and I don't think I've changed anything but now it's not working and I can't see anything wrong with the code.Basically I have a details view with product information in it, when the user clicks edit it goes into edit mode when I change any of the fields and click update it updates but with the old values. NET tutorials that are easy to follow and simple to implement.

To String()) End If Next End Sub " runat="server" Select Command="SELECT * FROM [Customers] WHERE ([Customer ID] = @Customer ID)" Insert Command="INSERT INTO [Customers] ([Customer ID], [Company Name], [Contact Name], [Contact Title], [Address], [City], [Region], [Postal Code], [Country], [Phone], [Fax]) VALUES (@Customer ID, @Company Name, @Contact Name, @Contact Title, @Address, @City, @Region, @Postal Code, @Country, @Phone, @Fax)" Update Command="UPDATE [Customers] SET [Company Name] = @Company Name, [Contact Name] = @Contact Name, [Contact Title] = @Contact Title, [Address] = @Address, [City] = @City, [Region] = @Region, [Postal Code] = @Postal Code, [Country] = @Country, [Phone] = @Phone, [Fax] = @Fax WHERE [Customer ID] = @Customer ID" is responsible for bringing you an exhaustive list of ASP.The product table is not updating with the new values.I think the problem is to do with the new values from the textbox not being retrieved.I have a Details View control and when it get's updated i send an email containing the new details. To String(); This works fine apart from when one of the fields i am refering to is blank. It's not so much code duplication i am tring to avoid as having to do a load of comparisons to see if a particular value is set or not. New Values("Some Field") to a function/method is that if Some Field is set to null in the Details Views control then rather than there being e.I have used the Item Updating event handler for the Details View and i am populating the Mail Message. New Values("Some Field") with a value of null, it simply does not exist. "Flinky Wisty Pomm" wrote: If you just want to avoid duplicated code, why not move it into another method?New Values("Some Field") with a value of null, it simply does not exist. "Flinky Wisty Pomm" wrote: If you just want to avoid duplicated code, why not move it into another method?