SqlConnection con = new SqlConnection(CS); con.Open(); SqlDataAdapter da = new SqlDataAdapter("sp_GetEmpDesignation", con); SqlCommandBuilder cmdbuild = new SqlCommandBuilder(da); DataSet ds = new DataSet(); da.Fill(ds,"EmpDesignation"); //BindingSource bgs = new BindingSource(ds, "EmpDesignation"); //// bgs.DataSource = ds; BindingSource bs = new BindingSource(ds, "EmpDesignation"); //dataGridView1.DataSource = bs; comboBoxDesg.DataSource = bs; comboBoxDesg.DisplayMember = "designation"; comboBoxDesg.ValueMember = "desgid"; SqlDataAdapter da1 = new SqlDataAdapter("GetDepartment", con); SqlCommandBuilder cmdbuild1 = new SqlCommandBuilder(da1); DataSet ds1 = new DataSet(); da1.Fill(ds1,"Department"); BindingSource bs1 = new BindingSource(ds1, "Department"); comboBoxDept.DataSource = bs1; comboBoxDept.DisplayMember = "department"; //SqlDataAdapter dac = new SqlDataAdapter("sp_GetEmpDesignation", con); con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)