Click here to Skip to main content
14,922,948 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ShoppingHeart.BusinessLayer;
using System.Data;




namespace ShoppingHeart.Admin
{
    public partial class CustomerOrders : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetOrderList();

            }

        }

       private void GetOrderList()

        {
            ShoppingCart k =new ShoppingCart

            {

                Flag=0

            };

            DataTable dt = k.GetOrderList();

            gvCustomerOrders.DataSource=dt;
            gvCustomerOrders.DataBind();
    }
    }
}
Posted
Updated 30-Jul-15 23:13pm
v2
Comments
DamithSL 31-Jul-15 5:34am
   
check in your ShoppingCart class for property called Flag, can you update the question with ShoppingCart class code with flag property code?

Your ShoppingCart has no "Flag" Property.
C#
ShoppingCart k =new ShoppingCart

        {

            Flag=0

        };


(Maybe its not public)
   
v3
Comments
Boopalslm 31-Jul-15 5:37am
   
ShoppingCart class file i was had "Flag" Proeprty - "public int Flag;" - This is my
ShoppingCart class Flag property script
Boopalslm 31-Jul-15 5:42am
   
How to convert a public in "Flag" - Give me ideas - Because i am beginner for .net.
Boopalslm 31-Jul-15 6:03am
   
now i am alter my ShoppingCart class file change to - public int Flag{get;set;} - But again i got same error. give me some suggestions.
stibee 31-Jul-15 6:07am
   
Show the code please of that class
Boopalslm 31-Jul-15 6:10am
   
namespace ShoppingHeart.BusinessLayer
{
public class ShoppingCart
{
public string CategoryName;
public int CategoryID;
public int ProductID;
public int CustomerID;

public string ProductName;
public string ProductImage;
public string ProductPrice;
public string ProductDescription;

public string CustomerName;
public string CustomerEmailID;
public string CustomerPhoneNo;
public string CustomerAddress;
public string ProductList;
public string PaymentMethod;

public string OrderStatus;
public string OrderNo;


public int TotalProducts;
public int TotalPrice;
public int StockType;


public int Flag { get; set; }




--------------------DB Coding ------------------------


internal DataTable GetOrderList()
{
SqlParameter[] parameters = new SqlParameter[1];
parameters[0] = DataLayer.DataAccess.AddParameter("@Flag", Flag, System.Data.SqlDbType.Int, 20);
DataTable dt = DataLayer.DataAccess.ExecuteDTByProcedure("SP_GetOrderList", parameters);
return dt; //i am write this line

}
Boopalslm 31-Jul-15 6:18am
   
Hello - are you find any errors my class file
stibee 31-Jul-15 6:19am
   
Please modfiy your question will all requiered code and the correct error message....
Boopalslm 31-Jul-15 6:21am
   
This is my error message sir,

Error Message: CS0117: 'ShoppingHeart.BusinessLayer.ShoppingCart' does not contain a definition for 'Flag'
stibee 31-Jul-15 6:27am
   
Are you shure that you compiled all correct?
If you create a new instance of the object what the intellisens does recommend?
Boopalslm 31-Jul-15 8:08am
   
yes sir, my compiled are correct, again once i am verify my files sir.
stibee 31-Jul-15 8:15am
   
Can you privide the whole project somewhere?
Boopalslm 1-Aug-15 1:38am
   
No, sir i am not provide my project anywhere
stibee 2-Aug-15 12:50pm
   
You would recommend that you start a new project.... (And do not write "sir" all the time)
Boopalslm 3-Aug-15 5:19am
   
Again i got error from anther one form - please give me some suggestions.

This is my Error.

Compiler Error Message: CS1061: 'ShoppingHeart.BusinessLayer.ShoppingCart' does not contain a definition for 'GetAllProducts' and no extension method 'GetAllProducts' accepting a first argument of type 'ShoppingHeart.BusinessLayer.ShoppingCart' could be found (are you missing a using directive or an assembly reference?)
stibee 3-Aug-15 5:32am
   
May you should post one your whole code... or read first a book "programming basic" otherwise it will be a never ending story.
Boopalslm 3-Aug-15 5:35am
   
k- Thank you.
I think there is no issue with the code it is working fine in my environment. Using build>> clean solution and try. If it won't work use ILDASM.exe to watch the shoppingcart class contains the property flag. If not remove the dll physically, build once and add it again. it works.

For ILDASM exe find below.
http://blogs.msdn.com/b/lucian/archive/2008/11/15/where-are-the-sdk-tools-where-is-ildasm.aspx[^]
   
Comments
Boopalslm 1-Aug-15 3:17am
   
Hello Sir, i am not understand below lins
If it won't work use ILDASM.exe to watch the shoppingcart class contains the property flag. If not remove the dll physically, build once and add it again. it works.

what can i do for please explain once sir.
Boopalslm 1-Aug-15 5:03am
   
sir i am follow your steps but not working sir, give me some suggestions
Rajesh Varma Buddaraju 3-Aug-15 13:27pm
   
Can you provide u r sample solution. I will try at my end...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900