Beispiel #1
0
    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        Login objlogin = new Login();

        objlogin.Address1 = txtAddress1.Value.ToString().Replace("'", "''");
        objlogin.username = txtUserName.Value;
        DataManipulationClass objdata = new DataManipulationClass();
        string strError = "";

        objdata.AddExpert(objlogin, ref strError);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            populateStateddl();
            Response.Write("Visiotrnmber:" + Convert.ToString(Application["activeVisitors"]));
        }
        string strErr   = "";
        Login  objlogin = new Login();

        objlogin.username = "******";
        objlogin.Address2 = "bb";
        DataManipulationClass objdata = new DataManipulationClass();

        objdata.AddExpert(objlogin, ref strErr);

        ArrayList MyList = new ArrayList();

        MyList.Add(1);
        MyList.Add(2);
        MyList.Add(3);
        MyList.Add(4);
        MyList.Add(5);
        // Create an iEnumerator object
        IEnumerator iEnum = MyList.GetEnumerator();

        // Loop through the data using the iEnumerator
        while (iEnum.MoveNext())
        {
            Response.Write((iEnum.Current.ToString()) + "<br>");
        }



        List <User> users = new List <User>();

        for (int x = 0; x < 5; x++)
        {
            User user = new User();
            user.Name = "Rob" + x;
            user.Age  = x;
            users.Add(user);
        }

        //foreach (User user in users)
        //{
        //    Response.Write(System.String.Format("{0}:{1}", user.Name, user.Age)+"<br>");
        //}
        Response.Write("<br>");
        //  System.Console.ReadLine();

        //for (int x = 0; x < users.Count; x++)
        //{
        //    Response.Write(System.String.Format("{0}:{1}", users[x].Name, users[x].Age));
        //}



        IEnumerator <User> ie = users.GetEnumerator();

        // Loop through the data using the iEnumerator
        while (ie.MoveNext())
        {
            Response.Write(ie.Current.Name.ToString() + ":" + ie.Current.Age.ToString() + "<br>");
        }



        //        List lst = new List();
        //lst.add("Abhishek");
        //lst.add("Abhijit");
        //lst.add("Manimoy");
        //lst.Add("Raj");
        //lst.Add("Ayan");
        //foreach(string x in lst){
        //if(x.length >5)
        //yeild return x;


        //    }
    }