[thelist] ASP.NET DataGrid Edit/Update problem
Rikter Web Design
support at rikter.com
Tue Jan 31 19:14:11 CST 2006
Hi Asif,
Thanks for responding. Permissions are ok. Even copied web files to a
different web host and still same problem. Even tried with SQL Server vs.
Access. Same problem.
Code was generated by VS2005. Works perfectly on localhost.
I checked again and don't see anything wrong with the postback, as it's
functioning properly everywhere except on all the various web hosts. One of
the web hosts I tried, hostmysite.com, told me the code was incorrect---but
of course not how it was incorrect. But since it works perfectly on
localhost, and generated with VS2005, I can't figure out what the problem
can be.
Google is useless because I've not found anyone on internet with this same
problem. It's the damnest thing. I just don't get it.
Chris
-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Asif Suria
Sent: Tuesday, January 31, 2006 2:59 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ASP.NET DataGrid Edit/Update problem
Check out the second argument for the update link. I think the ID is not
getting passed to the page during postback.
Another thing to check into is the permissions on the database/table to make
sure that web users can write or update to it.
Asif
---------------------------------------------------------------
If the doors of perception were cleansed everything would appear to man as
it is, infinite. - William Blake.
Yes, I am blogging @
http://www.sinletter.com/ablog.aspx
--- Rikter Web Design <support at rikter.com> wrote:
> Hi all,
>
> Tearing hair out over this one. Inserted an ASP.NET
> Gridview on page with
> edit ability to update an Access database. When I
> go to make edit, no error
> message occurs, just doesn't update records at all.
>
> Works perfectly on localhost. Problem is only when
> on web hosts, but tried
> two different hosts and problem is the same with
> both. Permissions on hosts
> were checked.
>
> Live page here:
> http://www.dickanddeedee.com/pwdtest.aspx
>
> Try changing any of the passwords and you'll see
> what I mean.
>
> Chris
>
>
> Code:
>
> <%@ Page Language="VB" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>
> <script runat="server">
>
> Protected Sub AccessDataSource1_Selecting(ByVal
> sender As Object, ByVal
> e As
>
System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
>
> End Sub
> </script>
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <asp:AccessDataSource ID="AccessDataSource1"
> runat="server"
> DataFile="~/fpdb/listdata.mdb"
> DeleteCommand="DELETE FROM [AdminAccess]
> WHERE [ID] = ?"
> InsertCommand="INSERT INTO [AdminAccess] ([ID],
> [Password], [Active]) VALUES
> (?, ?, ?)"
> SelectCommand="SELECT [ID], [Password],
> [Active] FROM
> [AdminAccess] WHERE ([AccessLevel] = ?)"
> UpdateCommand="UPDATE [AdminAccess] SET
> [Password] = ?, [Active]
> = ? WHERE [ID] = ?"
> OnSelecting="AccessDataSource1_Selecting">
> <DeleteParameters>
> <asp:Parameter Name="original_ID"
> Type="Int32" />
> </DeleteParameters>
> <UpdateParameters>
> <asp:Parameter Name="Password"
> Type="String" />
> <asp:Parameter Name="Active"
> Type="Boolean" />
> <asp:Parameter Name="original_ID"
> Type="Int32" />
> </UpdateParameters>
> <SelectParameters>
> <asp:Parameter DefaultValue="2"
> Name="AccessLevel"
> Type="Int32" />
> </SelectParameters>
> <InsertParameters>
> <asp:Parameter Name="ID"
> Type="Int32" />
> <asp:Parameter Name="Password"
> Type="String" />
> <asp:Parameter Name="Active"
> Type="Boolean" />
> </InsertParameters>
> </asp:AccessDataSource>
>
> </div>
> <asp:GridView ID="GridView1" runat="server"
> AllowSorting="True"
> AutoGenerateColumns="False"
> DataKeyNames="ID"
> DataSourceID="AccessDataSource1">
> <Columns>
> <asp:CommandField
> ShowEditButton="True" />
> <asp:BoundField DataField="ID"
> HeaderText="ID"
> InsertVisible="False" ReadOnly="True"
> SortExpression="ID" />
> <asp:BoundField DataField="Password"
> HeaderText="Password"
> SortExpression="Password" />
> <asp:CheckBoxField
> DataField="Active" HeaderText="Active"
> SortExpression="Active" />
> </Columns>
> </asp:GridView>
> </form>
> </body>
> </html>
>
> --
>
More information about the thelist
mailing list