Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0[ask]Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a da[ask]Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a da
Previous
 
Next
New Post
5/8/2007 11:58 AM
 

sorry for unclear information.

this is my case :

i have a gridview with a dropdownlist.

  •  The grid view is bounded to FileDataSource
  • The dropdownlist inside is bounded to CategoryDataSource
  • the FileDataSource connects to File Table which has Category_ID as foreign key
  • the CategoryDataSource connects to Category Table which has Category_ID as primary key

whenever i try to insert,update,or delete the data from category table the error message appears

which code do you need to know??

i'm using the gridview's footer row to insert data from grid view ...

 

 
New Post
5/8/2007 9:13 PM
 

The full error and the relevant code from the .ascx page. Also see if there is an error in the event viewwe in DotNetNuke



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
5/9/2007 3:50 AM
 

ok this is the gridview code, bounded to filedatasource, while the dropdownlist inside the gridview's footer row is bounded to categorydatasource

 <asp:SqlDataSource ID="FileDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
            DeleteCommand="DELETE FROM File_TA WHERE File_ID = @File_ID"
           
            <DeleteParameters>
                <asp:Parameter Name="File_ID" />
            </DeleteParameters>

</asp:SqlDataSource>

 <asp:GridView ID="GridView_File" runat="server" AutoGenerateColumns="False" DataKeyNames="File_ID"
            DataSourceID="FileDataSource" ShowFooter="True" style="table-layout: auto" AllowPaging="True" Width="920px">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:TemplateField HeaderText="ID" SortExpression="File_ID">
                    <EditItemTemplate>
                        <asp:Label ID="Label_EditFileID" runat="server" Text='<%# Eval("File_ID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label_FileID" runat="server" Text='<%# Bind("File_ID") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="Button_AddFile" runat="server" Text="Add" CommandName="InsertFile" ValidationGroup="File" />
                        <asp:TextBox ID="TextBox_FileID" runat="server" Visible="False" Width="118px"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category" SortExpression="Category_Name">
                    <EditItemTemplate>
                        &nbsp;<asp:DropDownList ID="EditCategoryList" runat="server"
                            SelectedValue='<%# Bind("Category_ID") %>' DataSourceID="CategoryDataSource" DataTextField="Category_Name" DataValueField="Category_ID" Width="80px">
                        </asp:DropDownList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Category_Name","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:DropDownList ID="CategoryList" runat="server" SelectedValue='<%# Bind("Category_ID") %>' DataSourceID="CategoryDataSource" DataTextField="Category_Name" DataValueField="Category_ID">
                        </asp:DropDownList>

                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="File Name" SortExpression="File_Name">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox_EditFileName" runat="server" Text='<%# Bind("File_Name") %>' Width="100px" Enabled="False"></asp:TextBox>&nbsp;
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("File_Name") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox_FileName" runat="server" Width="100px" ReadOnly="True"></asp:TextBox>&nbsp;
                        <asp:Label ID="FileNameLabel" runat="server"></asp:Label>
                    </FooterTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                    <FooterStyle Wrap="True" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Price" SortExpression="File_Price">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox_EditPrice" runat="server" Text='<%# Bind("File_Price") %>' Width="80px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredEditPrice" runat="server" ControlToValidate="TextBox_EditPrice"
                            Enabled="False" ErrorMessage="*" Text='<%# Eval("File_Price", "{0:N}") %>'></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                    <ItemTemplate>
                        Rp.
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("File_Price", "{0:N}") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox_FilePrice" runat="server" Width="80px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredPrice" runat="server" ControlToValidate="TextBox_FilePrice" ErrorMessage="*" ValidationGroup="File"></asp:RequiredFieldValidator>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Description" SortExpression="File_Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox_EditDescription" runat="server" Text='<%# Bind("File_Description") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("File_Description") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox_FileDescription" runat="server"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Location" SortExpression="File_Location">
                    <EditItemTemplate>
                        &nbsp;<asp:FileUpload ID="Edit_Location" runat="server" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("File_Location") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:FileUpload ID="File_Location" runat="server" />
                        <asp:RequiredFieldValidator ID="RequiredFileLocation" runat="server" ControlToValidate="File_Location"
                            ErrorMessage="*" ValidationGroup="File"></asp:RequiredFieldValidator>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle HorizontalAlign="Center" Wrap="True" />
</asp:GridView>

 

i don't put any code behind for delete event 

 

this one is a gridview which is bounded to category data source 

 

<asp:GridView ID="GridView_FileCategory" runat="server" AutoGenerateColumns="False" DataKeyNames="Category_ID"  DataSourceID="CategoryDataSource" ShowFooter="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:TemplateField HeaderText="Category_ID" SortExpression="Category_ID">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Category_ID") %>'></asp:Label>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="Button_AddCategory" runat="server" CommandName="Insert" Text="Add" ValidationGroup="Category" />
                        <asp:TextBox ID="TextBox_CategoryID" runat="server" Visible="False"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Category_ID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category_Name" SortExpression="Category_Name">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox_EditCategory" runat="server" Text='<%# Bind("Category_Name") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox_CategoryName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredCategory" runat="server" ControlToValidate="TextBox_CategoryName" ErrorMessage="*" ValidationGroup="Category"></asp:RequiredFieldValidator>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Category_Name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category_Description" SortExpression="Category_Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox_EditCategoryDescription" runat="server" Text='<%# Bind("Category_Description") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox_CategoryDescription" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Category_Description") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

<asp:SqlDataSource ID="CategoryDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
            DeleteCommand="DELETE FROM [File_TA_Category] WHERE [Category_ID] = @Category_ID"

            <DeleteParameters>
                <asp:Parameter Name="Category_ID" Type="Int32" />
            </DeleteParameters>

</asp:SqlDataSource>

 

the error message is exactly the same as title...that's all... that's why i dun understand either

 
New Post
5/9/2007 8:42 AM
 

Sorry,  I am at a loss.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
5/9/2007 2:15 PM
 

what do you mean?? sorry i dun understand

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0[ask]Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a da[ask]Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a da


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out