473,382 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

GridView not updating !!!

Hello all,

I have a problem with GridView - basically it will not update with the new values entered in edit mode.

I'm not sure why because when you step through the code you can see in e.NewValues that the updated values are being captured but for some reason not written to the data table.

Can anyone help??

Thanks in advance,
Sean
Jan 14 '08 #1
3 903
Please post the code.
Jan 14 '08 #2
Expand|Select|Wrap|Line Numbers
  1.                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
  2.                 DataKeyNames="CurrencyID" DataSourceID="ObjectDataSource1" ForeColor="#333333"
  3.                 GridLines="None" OnRowUpdating="GridView1_RowUpdating" OnRowUpdated="GridView1_RowUpdated" style="z-index: 100; left: 14px; position: absolute; top: 94px">
  4.                 <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  5.                 <Columns>
  6.                     <asp:BoundField DataField="CurrencyID" HeaderText="CurrencyID" InsertVisible="False"
  7.                         ReadOnly="True" SortExpression="CurrencyID" />
  8.                     <asp:BoundField DataField="Code" HeaderText="Code" SortExpression="Code" />
  9.                     <asp:BoundField DataField="Symbol" HeaderText="Symbol" SortExpression="Symbol" />
  10.                     <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
  11.                     <asp:BoundField DataField="Rate" HeaderText="Rate" SortExpression="Rate" />
  12.                 </Columns>
  13.                 <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
  14.                 <EditRowStyle BackColor="#999999" />
  15.                 <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
  16.                 <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  17.                 <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  18.                 <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
  19.             </asp:GridView>
  20.  
  21.             <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="{0}" SelectMethod="GetData"
  22.                 TypeName="Sunderlands.Events.Provider.AbetaWebAdminDatasetTableAdapters.currencyTableAdapter"
  23.                 UpdateMethod="Update" DeleteMethod="Delete" InsertMethod="Insert">
  24.                 <UpdateParameters>
  25.                     <asp:Parameter Name="Code" Type="String" />
  26.                     <asp:Parameter Name="Symbol" Type="String" />
  27.                     <asp:Parameter Name="Name" Type="String" />
  28.                     <asp:Parameter Name="Rate" Type="Double" />
  29.                     <asp:Parameter Name="Original_CurrencyId" Type="Int16" />
  30.                     <asp:Parameter Name="CurrencyID" Type="Int16" />
  31.                 </UpdateParameters>
  32.             </asp:ObjectDataSource>
Jan 14 '08 #3
Dear Sir/Madam,

Please send this solution as a cs file........im also having that problem.......
im using gridt_RowUpdating event............pls help me to solve the problem
Jan 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass...
3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
5
by: Brian McClellan | last post by:
Just wondering if anyone has a simple example of creating a gridview completely programmatically, i'm not doing anything terribly sophisticated. When creating the gridview declaratively evertying...
0
by: Michael Kellogg | last post by:
I have a problem wherein a query that updates a GridView doesn't seem to really stay in sync with a label I have above the GridView. I have a GridView object that I'm updating with information...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I have a gridview which I added a <asp:CommandField EditText="E" CancelText="C" UpdateText="U" ButtonType="Link" ShowEditButton="True" /> my gridview looks like this <asp:GridView...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
by: steve | last post by:
I have been fighting with trying to update a GridView for a while. I don't want to use the "built-in" way to do it because I am using business layer methods for updating and deleteing and I don't...
0
by: BizWeb | last post by:
Hi, i am new to ASP.NET. I have write a very simple code to try the updating of the GridView but it is not updating the data. Below is the simple code that i have use. <%@ Page Language="vb"...
2
by: xMetalDetectorx | last post by:
Hi Everyone, I have a very simple web app that uses .Net 2.0 login control to authenticate users and allow access to an "admin" folder. Inside that admin folder I have one page that has a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.