How do I fix a Edit GridView Error - Want to edit and update Gridview

Hello,

I keep getting this error when I edit and update a gridview.

 

Server Error in '/Albers_website' Application.

Updating is not supported by data source 'SqlHAPSource' unless UpdateCommand is specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Updating is not supported by data source 'SqlHAPSource' unless UpdateCommand is specified.

Source Error:

[NotSupportedException: Updating is not supported by data source 'SqlHAPSource' unless UpdateCommand is specified.]

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: Updating is not supported by data source 'SqlHAPSource' unless UpdateCommand is specified.]
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +210
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
   System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +162
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +118
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +175
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

0
TurfImage
8/3/2006 1:16:37 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
1086 Views

Similar Articles

[PageSpeed] 8
Get it on Google Play
Get it on Apple App Store

Hi,TurfImage

Do you have your update statement in the UpdateCommand in your customization  datasource?




Best Regards,
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support

This posting is provided "AS IS" with on warranties, and confers no rights.
0
rexlin
8/3/2006 2:43:25 AM

Well, I don't know what the statement should say...

Should it say True?

0
TurfImage
8/3/2006 4:39:38 AM

Yes I have the UpdateCommand in the datasource.

 

It works now without the error but the data does not update when I sumbit the "Update" button.

 

Any Ideas? 

0
TurfImage
8/4/2006 10:05:14 PM
Reply:

Similar Artilces:

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

DataList with Nested Editable/Deletable Gridviews. Gridviews not updating parent on edit/delete.
<DataList "Groups">  <Item>      <DataBound Title in DataList>       <Gridview of Items in "Current Group from DataList">       <SqlDataSource for GridView> </Item></DataList><SqlDataSource for DataList> Everything displays fine, I can edit individual rows in the nested grids and I can insert Rows in the grids.But the edit/delete events will not trigger the DataList to rebind its contents.. so onEdit/onDelete in the gridviews I say "DataList.Dat...

GridView and Javascript
Hey All, I need help from  you. I have a GridView. In the  Edit Item template of the first Column I have a textbox, an user control and hidden field. When I click on the user control it  opens a pop up from which I can choose the required value. The text value is populated in the textbox and Id in the hidden field. Here's the code for edit template.         <EditItemTemplate>                        <table cellpaddin...

why can't Gridview update if empty data is presented into the textfield of Gridview edit
 HI all,I have basically two fields which are Name,description. Whenever I was trying to edit fields(name, description) the command event is not firing because description(textbox) is empty. Why and how to fix this issuse. Because Name field is a required one and description is optional it could be empty one. Any help please thanks and regards,Vijaycanaan.  Can you please give your code. This can help us understand and solve your problem!! Here is the code   <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Aut...

Gridview : How to Edit the row in Gridview (update)
I have Gridview in which I'm displaying the row, I wanted to update/Modify the row  using custom button not with the link 'Edit' when I enable AutoGenerateEditButton ="true" Whenever user clicks on the Button, (ImageButton), it has to fire the event 'Gridview1_RowEditing'  Any help on this will be appreciated.    Your ImageButton simply needs to have its CommandName property set to "Edit".Thanks, EdMicrosoft MVP - ASP/ASP.NET  I am using one such logic, <asp:TemplateField HeaderText="Edit" Show...

Editable Child GridView inside editable parent gridview
Hi,  I need help writing a Paent/Child gridview combination. I need an editable parent gridview, inside templatefield of parent grid view I need an editable child gridview. Can any one post sample code. Hi jameston ,   <form id="form1" runat="server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" DeleteCommand="DELETE FROM [country] WHERE [countryid] = @countryid" InsertCommand="INSERT INTO [co...

edit and update a gridview control
Hi, Here's my question: The gridview shows all the items the student has already learned. Can the gridview be updated to add new data? For instance, the user wants to add another piece of item to learn and give a brief reason? I will add the dropdownlist and textbox control to the gridview (in edit mode, I assume)The dropdownlist will be bound to a datasource. Once the user has made a selection and typed a reason in the textbox, they will update the gridview to show what they have done. AFter they see that, they click a button which will launch a new page with the gridvi...

After hitting update on gridview, data changes but gridview still shows the update and cancel links for edited row
Really weird. I click the update link after I change the input data. I debug through it and it shows that the update is complete but then when OnRowUpdating function is done the update and cancel links are still there. What else do I need to do.. Here is the code. ASP:  <asp:GridView ID="OOWSecAuth" runat="server" AutoGenerateColumns="false" ShowFooter="true" AutoGenerateEditButton="true" OnRowEditing="OOWSecAuthEdit" OnRowUpdating="OOWSecAuthUpdate" ...

Editable GridView: Need C# code for Editable Gridview web part..!!
  I have created a Sharepoint Web Part programmatically in C# which fetches data from SQL database and displays in a Gridview. Its working fine. Now i need to make this gridview editable so that the changes should be reflected / saved back into SQL Database. I am running oout of time and need help immediately. Can somebody help me in getting the code for Editable Gridview please........???? Thank you Can Sombody help me out here.......... there are so many examples on the web http://msdn2.microsoft.com/en-us/library/ms972948.aspx http://www.experts-exchange.com/Programming/P...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Can I populate a Gridview outside of the Gridview using my own edit controls ?
I want to be able to populate a GridView control through some edit controls that willbe displayed above my GridView control. Is their a way to do this without using a DetailsView control ? (Refer to the following article) http://www.dotnetbips.com/articles/c1e0ca90-5f5d-47aa-a739-492b562e810a.aspx Or can I have my own edit controls seperately from the GridView control? Actually, all you need to do is to put some textboxes and button. Than on button click insert that data in database and bind data to your gridviewagain. __Please mark post as answer if it helps, if not come back and a...

GridView : how to Highlight the last edited Row in gridview and update Dropdrown
never mine i solve the prob. thanks Hi there,I think you are determining the edited row as:int index = GridView1.EditIndex;After finishing the update you must doing GridView1.DataBind();With in your update procedure last statement should be:GridView1.SelectedIndex = index;If you want to update the dropdown just say:DropDownList1.Items.Clear();DropDownList1.DataBind();Hope this helps,thanks,Murthy here Dont forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so we will all know you have be...

Updating and Editing options missing from GridView control.
I have followed lot of examples, tutorial and webcast, all of them show 5 options with GridView smart control.  For some reason in my case it shows only paging, sorting and selcting.  I am missing updating and deleting options.  Please ntoe, I am using the visual stutio 2005 professional.  Thanks....

Catch 22: Updating an editable GridView control?
Perhaps you can see the problem right away here... Dim strSQL As String = _          "UPDATE [tblICPMethods] SET [Frequency] = @Frequency, " & _          "[Calibration] = @Calibration, [QCValue] = @QCVAlue" & _          "WHERE [Frequency] = @Frequency AND [MethodNumber] = @MethodNumber" One of the fields the user can update is also one of two fields used as the primary key (MethodNumber being the other). @Freqeuncy will be the new value th...

GridView control enters edit mode only when I click Edit link twice
Hi all..I have a GridView control in an ASP.NET 2.0 page. I added a column that contains edit, update, cancel buttons. Because I did that, I had to handle RowEditing event or an exception was thrown.Well... this is the body of the RowEditing event:protected void gvParametros_RowEditing(object sender, GridViewEditEventArgs e){      gvParametros.EditIndex = e.NewEditIndex;}The fact is that when page is loaded and I click the edit link, page is refreshed but GridView doesn't enter edit mode. When I press edit link again, GridView enters edit mode.Any help to solve this behavior w...

Web resources about - How do I fix a Edit GridView Error - Want to edit and update Gridview - asp.net.presentation-controls

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 12/12/2015 1:48:39 PM