AccessDataSource does not update (1 Viewer)

bunny

New member
Local time
Today, 05:49
Joined
Oct 21, 2011
Messages
2
Hi there, Im using the following AccessDataSource (Connected to a datagrid) to try UPDATE bokks details on a database I'm working on, but it does not update or even give me any errors

Is there anything obvious I'm doing wrong with the AccessDataSource?
here is the code
<form id="form1" runat="server">

<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/database/books.mdb" SelectCommand="SELECT * FROM [books]"
UpdateCommand="UPDATE books SET bookName =@bookName, boyear =@boyear, puplisher_id =@puplisher_id where book_id=@book_id"></asp:AccessDataSource>

<center>
<asp:GridView ID="bok" runat="server" AutoGenerateColumns="False"
DataKeyNames="book_id" DataSourceID="AccessDataSource1">
<Columns>
<asp:BoundField DataField="book_id" HeaderText="book_id" ReadOnly="True"
SortExpression="book_id"/>
<asp:BoundField DataField="bookName" HeaderText="bookName"
SortExpression="bookName"/>
<asp:BoundField DataField="boyear" HeaderText="boyear"
SortExpression="boyear"/>
<asp:BoundField DataField="puplisher_id" HeaderText="puplisher_id"
SortExpression="puplisher_id"/>
<asp:BoundField DataField="ispublish" HeaderText="ispublish"
SortExpression="ispublish"/>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"/>
</Columns>
</asp:GridView>


</center>
</form>
 
Last edited:

Users who are viewing this thread

Top Bottom