Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1");

            DataSet   ds1 = s.GetCompanyData();
            DataTable dt1 = ds1.Tables[0];


            GridView1.DataSource = dt1;
            GridView1.DataBind();
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1");
                DataSet       ds = s.GetCompanyData();
                DataTable     dt = ds.Tables[0];
                List <string> l  = (from DataRow dr in dt.Rows

                                    select(string) dr["name"]).ToList <string>();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Label1.Text = "Select Company";
                ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1");
                DataSet       ds = s.GetCompanyData();
                DataTable     dt = ds.Tables[0];
                List <string> l  = (from DataRow dr in dt.Rows

                                    select(string) dr["name"]).ToList <string>();
                var fl = l.Distinct();
                DropDownList1.DataSource = fl.ToList();
                DropDownList1.DataBind();
            }
        }
        protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
        {
            ServiceReference2.Service1Client s = new ServiceReference2.Service1Client("BasicHttpBinding_IService1");
            //  JobPortalRef.Service1Client s = new JobPortalRef.Service1Client("BasicHttpBinding_IService1");
            string c = DropDownList1.SelectedValue;//.Text;

            DataSet   ds1             = s.GetCompanyData();
            DataTable dt1             = ds1.Tables[0];
            string    SearchByColumn1 = "name = name";// + c;
            var       rows1           = dt1.AsEnumerable()
                                        .Where(r => r.Field <string>("name") == c);

            if (rows1.Any())
            {
                GridView1.DataSource = rows1.CopyToDataTable();
            }
            GridView1.DataBind();
        }