Advertisement

02.21.2008 at 07:22PM PST, ID: 23183456
[x]
Attachment Details

gridview with db2 backend  updatecommand

Asked by dougc98275 in Visual Studio 2008, DB2 Database, .NET Framework 2.0

Tags: vb.net, IE6+

Trying to do a simple gridview control with 1 table from DB2.  For ex, select * from jobs.  I can get the select to work fine, but delete and update give me incorrect number of parameters or no error, but no update or delete is done.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
SelectCommand="SELECT POS_ID, DESCRIPTION FROM RSIUDB.POS_REF;"
        Updatecommand="update rsiudb.pos_ref set description=@DESCRIPTION where POS_ID=@POS_ID;"
        deletecommand="delete from rsiudb.pos_ref where description=@DESCRIPTION">
        
            <DeleteParameters>
                <asp:Parameter  name="@description" type="String" />
               </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="@Description"  Type="string" />
                <asp:Parameter Name="@POS_ID"  Type="Int16" />
                
            </UpdateParameters>
        </asp:SqlDataSource>
        
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1"
            DataKeyNames="POS_ID"
             AutoGenerateEditButton="True">
            
            <Columns>
                <asp:BoundField DataField="POS_ID" HeaderText="POS_ID" ReadOnly="True" SortExpression="POS_ID" />
                <asp:BoundField DataField="DESCRIPTION" HeaderText="DESCRIPTION" SortExpression="DESCRIPTION" />
            
                
            </Columns>
        </asp:GridView>
[+][-]02.22.2008 at 02:04PM PST, ID: 20961921

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio 2008, DB2 Database, .NET Framework 2.0
Tags: vb.net, IE6+
Sign Up Now!
Solution Provided By: momi_sabag
Participating Experts: 1
Solution Grade: B
 
 
[+][-]02.22.2008 at 02:06PM PST, ID: 20961937

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628