Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Редактирование данных в FormView / 3 сообщений из 3, страница 1 из 1
30.08.2006, 18:23
    #33953586
Snorry
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Редактирование данных в FormView
Доброго времени суток!
Подскажите пожалуйста, куда копать. При попытке редактировать данные на страничке (код ниже) выдается сообщение:


В операции должен использоваться обновляемый запрос.
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.Data.OleDb.OleDbException: В операции должен использоваться обновляемый запрос.

Source Error:

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.

Собственно код.


<%@ Page Language="C#" MasterPageFile="~/Src/AdminMasterPage.master" AutoEventWireup="true" CodeFile="Forms_News.aspx.cs" Inherits="Src_Forms_News" Title="Untitled Page" StylesheetTheme="Default" Theme="Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdmContentPlaceHolder" Runat="Server">
    <asp:AccessDataSource ID="adsNews" runat="server" ConflictDetection="CompareAllValues"
        DataFile="~/App_Data/rootkits.mdb" DeleteCommand="DELETE FROM [LNews] WHERE [IDNews] = ? AND [Author] = ? AND [DateTime] = ? AND [Title] = ? AND [Content] = ? AND [Image] = ? AND [PathImage] = ? AND [LastEdit] = ? AND [TSR] = ?"
        InsertCommand="INSERT INTO [LNews] ([IDNews], [Author], [DateTime], [Title], [Content], [Image], [PathImage], [LastEdit], [TSR]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [IDNews], [Author], [DateTime], [Title], [Content], [Image], [PathImage], [LastEdit], [TSR] FROM [LNews] WHERE ([IDNews] = ?)"
        UpdateCommand="UPDATE [LNews] SET [Author] = ?, [DateTime] = ?, [Title] = ?, [Content] = ?, [Image] = ?, [PathImage] = ?, [LastEdit] = ?, [TSR] = ? WHERE [IDNews] = ? AND [Author] = ? AND [DateTime] = ? AND [Title] = ? AND [Content] = ? AND [Image] = ? AND [PathImage] = ? AND [LastEdit] = ? AND [TSR] = ?">
        <DeleteParameters>
            <asp:Parameter Name="original_IDNews" Type="Int32" />
            <asp:Parameter Name="original_Author" Type="Int32" />
            <asp:Parameter Name="original_DateTime" Type="DateTime" />
            <asp:Parameter Name="original_Title" Type="String" />
            <asp:Parameter Name="original_Content" Type="String" />
            <asp:Parameter Name="original_Image" Type="String" />
            <asp:Parameter Name="original_PathImage" Type="String" />
            <asp:Parameter Name="original_LastEdit" Type="DateTime" />
            <asp:Parameter Name="original_TSR" Type="Int16" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Author" Type="Int32" />
            <asp:Parameter Name="DateTime" Type="DateTime" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="PathImage" Type="String" />
            <asp:Parameter Name="LastEdit" Type="DateTime" />
            <asp:Parameter Name="TSR" Type="Int16" />
            <asp:Parameter Name="original_IDNews" Type="Int32" />
            <asp:Parameter Name="original_Author" Type="Int32" />
            <asp:Parameter Name="original_DateTime" Type="DateTime" />
            <asp:Parameter Name="original_Title" Type="String" />
            <asp:Parameter Name="original_Content" Type="String" />
            <asp:Parameter Name="original_Image" Type="String" />
            <asp:Parameter Name="original_PathImage" Type="String" />
            <asp:Parameter Name="original_LastEdit" Type="DateTime" />
            <asp:Parameter Name="original_TSR" Type="Int16" />
        </UpdateParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="IDNews" QueryStringField="IDNews" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="IDNews" Type="Int32" />
            <asp:Parameter Name="Author" Type="Int32" />
            <asp:Parameter Name="DateTime" Type="DateTime" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="PathImage" Type="String" />
            <asp:Parameter Name="LastEdit" Type="DateTime" />
            <asp:Parameter Name="TSR" Type="Int16" />
        </InsertParameters>
    </asp:AccessDataSource>
    <asp:FormView ID="fwNews" runat="server" AllowPaging="True" CellPadding="4" DataKeyNames="IDNews"
        DataSourceID="adsNews" ForeColor="#333333">
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <EditItemTemplate>
            IDNews:
            <asp:Label ID="IDNewsLabel1" runat="server" Text='<%# Eval("IDNews") %>'></asp:Label><br />
            Author:
            <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>'>
            </asp:TextBox><br />
            DateTime:
            <asp:TextBox ID="DateTimeTextBox" runat="server" Text='<%# Bind("DateTime") %>'>
            </asp:TextBox><br />
            Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>'>
            </asp:TextBox><br />
            Content:
            <asp:TextBox ID="ContentTextBox" runat="server" Text='<%# Bind("Content") %>'>
            </asp:TextBox><br />
            Image:
            <asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>'>
            </asp:TextBox><br />
            PathImage:
            <asp:TextBox ID="PathImageTextBox" runat="server" Text='<%# Bind("PathImage") %>'>
            </asp:TextBox><br />
            LastEdit:
            <asp:TextBox ID="LastEditTextBox" runat="server" Text='<%# Bind("LastEdit") %>'>
            </asp:TextBox><br />
            TSR:
            <asp:TextBox ID="TSRTextBox" runat="server" Text='<%# Bind("TSR") %>'>
            </asp:TextBox><br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                Text="Update">
            </asp:LinkButton>
            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel">
            </asp:LinkButton>
        </EditItemTemplate>
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <InsertItemTemplate>
            Author:
            <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>'>
            </asp:TextBox><br />
            DateTime:
            <asp:TextBox ID="DateTimeTextBox" runat="server" Text='<%# Bind("DateTime") %>'>
            </asp:TextBox><br />
            Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>'>
            </asp:TextBox><br />
            Content:
            <asp:TextBox ID="ContentTextBox" runat="server" Text='<%# Bind("Content") %>'>
            </asp:TextBox><br />
            Image:
            <asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>'>
            </asp:TextBox><br />
            PathImage:
            <asp:TextBox ID="PathImageTextBox" runat="server" Text='<%# Bind("PathImage") %>'>
            </asp:TextBox><br />
            LastEdit:
            <asp:TextBox ID="LastEditTextBox" runat="server" Text='<%# Bind("LastEdit") %>'>
            </asp:TextBox><br />
            TSR:
            <asp:TextBox ID="TSRTextBox" runat="server" Text='<%# Bind("TSR") %>'>
            </asp:TextBox><br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="Insert">
            </asp:LinkButton>
            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel">
            </asp:LinkButton>
        </InsertItemTemplate>
        <ItemTemplate>
            IDNews:
            <asp:Label ID="IDNewsLabel" runat="server" Text='<%# Eval("IDNews") %>'></asp:Label><br />
            Author:
            <asp:Label ID="AuthorLabel" runat="server" Text='<%# Bind("Author") %>'></asp:Label><br />
            DateTime:
            <asp:Label ID="DateTimeLabel" runat="server" Text='<%# Bind("DateTime") %>'></asp:Label><br />
            Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>'></asp:Label><br />
            Content:
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Bind("Content") %>'></asp:Label><br />
            Image:
            <asp:Label ID="ImageLabel" runat="server" Text='<%# Bind("Image") %>'></asp:Label><br />
            PathImage:
            <asp:Label ID="PathImageLabel" runat="server" Text='<%# Bind("PathImage") %>'></asp:Label><br />
            LastEdit:
            <asp:Label ID="LastEditLabel" runat="server" Text='<%# Bind("LastEdit") %>'></asp:Label><br />
            TSR:
            <asp:Label ID="TSRLabel" runat="server" Text='<%# Bind("TSR") %>'></asp:Label><br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                Text="Edit">
            </asp:LinkButton>
            <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                Text="Delete">
            </asp:LinkButton>
            <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                Text="New">
            </asp:LinkButton>
        </ItemTemplate>
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
    </asp:FormView>
</asp:Content>
...
Рейтинг: 0 / 0
30.08.2006, 20:47
    #33953854
Dimon aka Manowar
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Редактирование данных в FormView
Для папки, в которой лежит mdb файл дать права Full Access для юзера, под которым крутится сайт.

Многие вещи нам непонятны не оттого, что наши понятия слабы, а оттого, что данные вещи не входят в круг наших понятий.
...
Рейтинг: 0 / 0
31.08.2006, 11:34
    #33954843
Snorry
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Редактирование данных в FormView
Здравствуйте, Dimon aka Manowar, Вы писали:

DAM>Для папки, в которой лежит mdb файл дать права Full Access для юзера, под которым крутится сайт.

DAM>
данное сообщение получено с www.gotdotnet.ru
DAM>ссылка на оригинальное сообщение


Спасибо! Поставил все как вы посоветовали, но увы, тот же результат.
...
Рейтинг: 0 / 0
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Редактирование данных в FormView / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]