Hi all I created a project that has a Formview bound to a Gridview. All the other commands seem to work fine except when I try to update the form view I get the error in the tit
I fixed this error in my project by changing all the names of the fields in my table to one word, or words separated by underlines (e.g. first_name), then changing the update code to use the new names.
Remove the square brackets around the field names in your Bind statements, eg
<asp:TextBox ID="Job_TitleTextBox" runat="server"
Text='<%# Bind("Job Title") %>' />
The brackets are really necessary only in the query portion of the UpdateCommand to allow for the presence of spaces in the field names. The brackets can cause all kinds of strange confusion in the background code ASP.NET generates when building the page. Hope that helps.
Here's an excerpt from this reference:
Check the SqlDataSource object for any fields you’ve pulled or renamed with spaces in them. An ‘_’ Underscore will work fine, but doing a query like this "Select [somename] as [Some Name] FROM [names] WHERE [id]=@id" will result in the above error
Try replacing all the spaces with underscores (e.g. Job_Title)