Click here to Skip to main content
15,920,508 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Timesheet System... Pin
David Mujica16-Nov-09 4:23
David Mujica16-Nov-09 4:23 
QuestionIdea About documentation. Pin
lrsalunkhe15-Nov-09 18:38
lrsalunkhe15-Nov-09 18:38 
AnswerRe: Idea About documentation. Pin
Christian Graus15-Nov-09 19:50
protectorChristian Graus15-Nov-09 19:50 
Questioncommon practice for development 3 tiered application Pin
uglyeyes15-Nov-09 17:26
uglyeyes15-Nov-09 17:26 
AnswerRe: common practice for development 3 tiered application Pin
Christian Graus15-Nov-09 17:27
protectorChristian Graus15-Nov-09 17:27 
GeneralRe: common practice for development 3 tiered application [modified] Pin
uglyeyes15-Nov-09 17:45
uglyeyes15-Nov-09 17:45 
GeneralRe: common practice for development 3 tiered application Pin
Christian Graus15-Nov-09 19:37
protectorChristian Graus15-Nov-09 19:37 
GeneralRe: common practice for development 3 tiered application Pin
uglyeyes15-Nov-09 22:03
uglyeyes15-Nov-09 22:03 
I thought so too. but do I need to pass this instance into class constructor?
public Product()
{
this.Category = null;
}
public Product(parameters..., Category c)
{
...
this.Category = c
}
...
...
 public Category cat
        {
            get { return _category; }
            set { _category = value; }           
        }

part of my BLL
   public static class myBLL
    {
        public static List<Product> GetProducts(string CountryName, string AdCity, string AdSubCatType)
        {
            return myDAL.Instance.GetProducts(CountryName,AdCity,AdSubCatType);
        }
part of my DAL

public List<Product> GetProductss(string CountryName, string AdCity, string AdSubCatType)
        {
            using (SqlConnection oConn = new SqlConnection(_connectionString)) {
                string strSql = "spGetProductListList";
                SqlCommand oCmd = new SqlCommand(strSql, oConn);
                oCmd.CommandType = CommandType.StoredProcedure;
                oCmd.Parameters.Add(new SqlParameter("@CountryName", SqlDbType.NVarChar, 50)).Value = CountryName;
                oCmd.Parameters.Add(new SqlParameter("@AdCity", SqlDbType.NVarChar, 200)).Value = AdCity;
                oCmd.Parameters.Add(new SqlParameter("@AdSubCatType", SqlDbType.NVarChar, 50)).Value = AdSubCatType;               
               
                oConn.Open();
                string m = oCmd.ToString();
                
                // execute query
                SqlDataReader oReader = oCmd.ExecuteReader();
                List<Product> products= null;
                products = GetProductCollectionFromReader(oReader);
                oReader.Close();
                return products;
            }
        }
protected List<Product> GetProductCollectionFromReader(IDataReader oReader)
        {
            List<Product> products = new List<Product>();
            while( oReader.Read() )
                // read line by line and map to an object
                products.Add(GetProductFromReader(oReader));

            return products;
        }
protected Product GetProductFromReader(IDataRecord oReader)
        {
            Product product = new Product();
            product.ProductId = (int)oReader["ProductId"];
            ....
            product.Category.CategoryName  = (string)oReader["CategoryName"];//I get exception here not sure how can i set value of category
            product.Category.CategoryCode = (string)oReader["CategoryCode"];

          
            return product;
        }

GeneralRe: common practice for development 3 tiered application Pin
uglyeyes15-Nov-09 22:16
uglyeyes15-Nov-09 22:16 
QuestionI want to create paging by Datalist language VB.net [modified] Pin
sunshinesnow15-Nov-09 16:13
sunshinesnow15-Nov-09 16:13 
AnswerRe: I want to create paging by Datalist language VB.net Pin
Not Active15-Nov-09 16:18
mentorNot Active15-Nov-09 16:18 
QuestionSintax problem Pin
Maxdd 715-Nov-09 15:46
Maxdd 715-Nov-09 15:46 
AnswerRe: Sintax problem Pin
_Damian S_15-Nov-09 15:55
professional_Damian S_15-Nov-09 15:55 
GeneralRe: Sintax problem Pin
Maxdd 715-Nov-09 16:01
Maxdd 715-Nov-09 16:01 
GeneralRe: Sintax problem Pin
Not Active15-Nov-09 16:20
mentorNot Active15-Nov-09 16:20 
GeneralRe: Sintax problem Pin
Christian Graus15-Nov-09 17:26
protectorChristian Graus15-Nov-09 17:26 
GeneralRe: Sintax problem Pin
Maxdd 715-Nov-09 17:31
Maxdd 715-Nov-09 17:31 
GeneralRe: Sintax problem Pin
Not Active15-Nov-09 18:10
mentorNot Active15-Nov-09 18:10 
GeneralRe: Sintax problem Pin
Maxdd 715-Nov-09 18:23
Maxdd 715-Nov-09 18:23 
GeneralRe: Sintax problem Pin
Christian Graus15-Nov-09 19:41
protectorChristian Graus15-Nov-09 19:41 
GeneralRe: Sintax problem Pin
Christian Graus15-Nov-09 19:38
protectorChristian Graus15-Nov-09 19:38 
Questionbinding an arraylist to datalist and implement pagination in Presentation Layer [modified] Pin
uglyeyes15-Nov-09 12:16
uglyeyes15-Nov-09 12:16 
AnswerRe: binding an arraylist to datalist and implement pagination in Presentation Layer Pin
Abhishek Sur15-Nov-09 12:29
professionalAbhishek Sur15-Nov-09 12:29 
GeneralRe: binding an arraylist to datalist and implement pagination in Presentation Layer Pin
uglyeyes15-Nov-09 13:15
uglyeyes15-Nov-09 13:15 
GeneralRe: binding an arraylist to datalist and implement pagination in Presentation Layer Pin
Abhishek Sur15-Nov-09 21:15
professionalAbhishek Sur15-Nov-09 21:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.