Demo entry 6626010



Submitted by 13 on Jun 23, 2017 at 04:20
Language: C#. Code size: 1.0 kB.

 protected void ddlsavedep_SelectedIndexChanged(object sender, EventArgs e)
        string strSQL;
        DropDownList ddlnewcompany = dvDetail.FindControl("ddlnewcompany") as DropDownList;
        DropDownList ddlsavedep = dvDetail.FindControl("ddlsavedep") as DropDownList;
        strSQL = "select   HE.EMPLOYEE_CNAME ,HE.EMPLOYEE_NO from SR06.[27525541].dbo.HRMS_EMPLOYEE HE inner join SR06.[27525541].dbo.HRMS_DEPARTMENT HD on HD.DEPARTMENT_ID = HE.DEPARTMENT_ID where HD.company_id = @company_id and HE.DEPARTMENT_ID= @DEPARTMENT_ID";
        dssaveman.SelectParameters.Add("company_id", ddlnewcompany.SelectedValue.ToString());
        dssaveman.SelectParameters.Add("DEPARTMENT_ID", ddlsavedep.SelectedValue.ToString());
        dssaveman.SelectCommand = strSQL;
        dssaveman.SelectCommandType = SqlDataSourceCommandType.Text;
        TextBox txtEditno = dvDetail.FindControl("txtEditno") as TextBox;
        txtEditno.Text = "";

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).