Click here to Skip to main content
15,887,485 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)
 
Share this answer
 
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

}
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[^]
 
Share this answer
 
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 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)



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