ASP.NET

Associate
Joined
2 Dec 2006
Posts
71
Hi guys,
Ive been designing a website and been having problems with creating my shooping basket, ive designed and made the shopping cart but have came across this one error for over 2 days now! I was wondering if anyone can see if they know what the problem is and help me. If anyone thinks they can can you add me on msn
 
Last edited:
Maybe if you described the error you're getting and showed us the code you're using, people might be more inclined to respond... rather than add someone they don't know to msn....
 
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Units'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Units'.

Source Error:


Line 14: </FooterTemplate>
Line 15: <ItemTemplate>
Line 16: <asp:Label ID="Label7" runat="server" Text='<%# Eval("Units") %>'></asp:Label>
Line 17: </ItemTemplate>
Line 18: </asp:TemplateField>
 
This is how I would do it mate...
Code:
                    <FooterTemplate>
                        <asp:DropDownList ID="DDLUser" runat="server">
                        </asp:DropDownList>
                    </FooterTemplate>

Code:
    protected void UsedList_OnRowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            DataSet ds = SQLQueries.DDLUserNo();

            DropDownList DdlUser = (DropDownList)e.Row.FindControl("DDLUser");

            DdlUser.DataSource = ds;
            DdlUser.DataTextField = "UserName";
            DdlUser.DataValueField = "UserID";
            DdlUser.DataBind();


        }
    }

Does this help??

Stelly
 
Ok here goes...

Code:
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>

Code:
protected void SoftList_OnRowCreated(object sender, GridViewRowEventArgs e)
{

DataSet Fill = SQLQueries.PopulateSoft(ID);

Label blah = (Label)SoftList.FooterRow.FindControl("LabelNo");

DataRow Soft = Fill.Tables[0].Rows[0];

blah.Text = soft["Units"].ToString();


}

Should work...

Stelly
 
erm ive added the code but more problems seem to happening now it doesnt like the SQL statements, is there any chacne i could send u my project and you have a look at it please, the help would be much appreciated. Ive had this problem for over 2 days no its so frustrating!
 
these errors come up , but i havent edited m web config yet as i do not know what u mean?


C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(26,35): warning CS0618: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(32,9): error CS0127: Since 'Basket.GridView1_OnRowCreated(object, System.Web.UI.WebControls.GridViewRowEventArgs)' returns void, a return keyword must not be followed by an object expression
C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(36,29): error CS0103: The name 'SoftList' does not exist in the current context
Validation Complete
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
 
jackybaby said:
these errors come up , but i havent edited m web config yet as i do not know what u mean?


C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(26,35): warning CS0618: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(32,9): error CS0127: Since 'Basket.GridView1_OnRowCreated(object, System.Web.UI.WebControls.GridViewRowEventArgs)' returns void, a return keyword must not be followed by an object expression
C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(36,29): error CS0103: The name 'SoftList' does not exist in the current context
Validation Complete
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========


Sent you files :)

Stelly
 
just the one error now mate :D got to love the programming lol

Validating Web Site
Building directory '/JacksPosterShop/'.

C:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx.cs(32,9): error CS0127: Since 'Basket.GridView1_OnRowCreated(object, System.Web.UI.WebControls.GridViewRowEventArgs)' returns void, a return keyword must not be followed by an object expression
Validation Complete
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
 
Back
Top Bottom