Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2006, 04:47 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hawkfb63
Default Access Database Manipulation From Gridview

I have been using gridviews to edit and delete data from my database and successfully made several pages to interact with my database. I am having a problem with my final page though. I do not get any errors when I run the page, but the data will not update or delete. I have included code below. I am hoping I just am overlooking something small and somebody will be able to notice my mistake.



<asp:GridView ID="GridView1" DataKeyNames="Date_Required,ItemNo,Purchase_Order_ No" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource3">

<Columns>

<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />

<asp:BoundField DataField="Date_Shipped" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date_Shipped"

HtmlEncode="False" SortExpression="Date_Shipped" />

<asp:BoundField DataField="Date_Required" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date_Required"

HtmlEncode="False" ReadOnly="True" SortExpression="Date_Required" />

<asp:BoundField DataField="Quantity_Shipped" HeaderText="Quantity_Shipped" SortExpression="Quantity_Shipped" ReadOnly="false" />

<asp:BoundField DataField="ItemNo" HeaderText="ItemNo" ReadOnly="True" SortExpression="ItemNo" />

<asp:BoundField DataField="Purchase_Order_No" HeaderText="Purchase_Order_No" ReadOnly="True"

SortExpression="Purchase_Order_No" />

<asp:BoundField DataField="Container_No" HeaderText="Container_No" SortExpression="Container_No" />

</Columns>

</asp:GridView>

<asp:AccessDataSource DataSourceMode="dataset" ID="AccessDataSource3" runat="server" DataFile="~/App_Data/customerandproduct.mdb"

DeleteCommand="DELETE * FROM [Shipment_Part] Where( [BolNo] = @BolNo AND [ItemNo] = @ItemNo AND [Date_Required] = @Date_Required AND [Purchase_Order_No] = @Purchase_Order_No)"

SelectCommand="SELECT [Date_Shipped], [Date_Required], [Quantity_Shipped], [ItemNo], [Purchase_Order_No], [Container_No], [BolNo] FROM [Shipment_part] WHERE ([BolNo] = ?)"

UpdateCommand="UPDATE [Shipment_Part] SET [Date_Shipped] = @Date_Shipped, [Quantity_Shipped] = @Quantity_Shipped, [Container_No] = @Container_No Where ([BolNo] = @BolNo AND [ItemNo] = @ItemNo AND [Date_Required] = @Date_Required AND [Purchase_Order_No] = @Purchase_Order_No)" >

<SelectParameters>

<asp:ControlParameter ControlID="DropDownList1" Name="BolNo" PropertyName="SelectedValue"

Type="String" />

</SelectParameters>

<UpdateParameters>

<asp:Parameter Name="Date_Shipped" Type="String" ></asp:Parameter>

<asp:Parameter Name="Quantity_Shipped" Type="Int64" ></asp:Parameter>

<asp:Parameter Name="Container_No" Type="String" ></asp:Parameter>

<asp:Parameter Name="BolNo" Type="String" ></asp:Parameter>

<asp:Parameter Name="ItemNo" Type="String" ></asp:Parameter>

<asp:Parameter Name="Date_Required" Type="String" ></asp:Parameter>

<asp:Parameter Name="Purchase_Order_No" Type="String" ></asp:Parameter>


</UpdateParameters>

</asp:AccessDataSource>







Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I store Gridview into Database? divekar.vishal ASP.NET 2.0 Basics 3 April 26th, 2008 08:14 AM
How to Store data from GridView to DataBase? divekar.vishal ASP.NET 2.0 Basics 0 April 18th, 2008 06:24 AM
Updating a gridview control w/access database p3aul ASP.NET 1.0 and 1.1 Professional 0 October 2nd, 2007 06:14 PM
Access import and table manipulation scubasteve Access 1 June 12th, 2006 12:57 PM
Gridview not updating database on Web Host jumpseatnews ASP.NET 2.0 Basics 3 February 2nd, 2006 10:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.