Hi
I am trying to update via an datagrid only nothing seems to happen
how would I diplay what the update query looks like msgbox
reponse.write? where do I put em?
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
void DetailsView1_It emUpdated(Objec t sender,
DetailsViewUpda tedEventArgs e)
{
GridView1.DataB ind();
}
void DetailsView1_It emInserted(Obje ct sender,
DetailsViewInse rtedEventArgs e)
{
GridView1.DataB ind();
}
void DetailsView1_It emDeleted(Objec t sender,
DetailsViewDele tedEventArgs e)
{
GridView1.DataB ind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Editin g Access Database</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:AccessData Source ID="AccessDataS ource1" Runat="server"
DataFile="data\ pubs.mdb"
SelectCommand=" select * from [authors],[books] where au_id
= author_key" >
</asp:AccessDataS ource>
<asp:GridView ID="GridView1" Runat="server" AllowPaging="Tr ue"
AllowSorting="T rue" DataSourceID="A ccessDataSource 1"
DataKeyNames="a u_id" AutoGenerateSel ectButton="True ">
</asp:GridView>
<asp:AccessData Source ID="AccessDataS ource2" Runat="server"
DataFile="data\ pubs.mdb"
SelectCommand=" select * from [authors],[books] where au_id
= author_key"
DeleteCommand=" DELETE FROM [authors] WHERE [au_id] = ?"
UpdateCommand=" UPDATE [books] SET [book_title] = ? WHERE
[author_key] = ?"
InsertCommand=" INSERT INTO [authors] ([au_id], [au_lname],
[au_fname], [phone], [address], [city], [state], [zip], [contract],
[author_key], [book_title]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
FilterExpressio n="au_id='@au_i d'">
<FilterParamete rs>
<asp:ControlPar ameter Name="au_id"
ControlID="Grid View1"
PropertyName="S electedValue"></asp:ControlPara meter>
</FilterParameter s>
</asp:AccessDataS ource>
<asp:DetailsVie w ID="DetailsView 1" Runat="server"
AutoGenerateDel eteButton="True "
AutoGenerateEdi tButton="True"
DataSourceID="A ccessDataSource 2" DataKeyNames="a u_id"
AutoGenerateIns ertButton="True "
onitemupdated=" DetailsView1_It emUpdated"
oniteminserted= "DetailsView1_I temInserted"
onitemdeleted=" DetailsView1_It emDeleted">
</asp:DetailsView >
</div>
</form>
</body>
</html>