public void FillModule() { DataTable Dt = new DataTable(); DataTable Dtapplication = objSys.GetSysParameterByParamName("Application_Id"); Dt = objModule.GetModuleMaster(); Dt = new DataView(Dt, "Application_Id=" + Dtapplication.Rows[0]["Param_Value"].ToString() + "", "", DataViewRowState.CurrentRows).ToTable(); if (Dt.Rows.Count > 0) { ddlModuleName.DataSource = Dt; ddlModuleName.DataTextField = "Module_Name"; ddlModuleName.DataValueField = "Module_Id"; ddlModuleName.DataBind(); } else { Dt.Clear(); ddlModuleName.DataSource = Dt; ddlModuleName.DataBind(); } ddlModuleName.Items.Insert(0, "--Select--"); }