コード例 #1
0
 private void getTah()
 {
     try
     {
         if (DDL_Dist.SelectedItem.Text != "--Select--")
         {
             SqlObj = new SqlString(ComObj);
             string  strSql = "select * from LR_TehsilMaster tm,DistrictMaster dm where dm.DistNo_LRMP=tm.Distno and dm.DistrictCode='" + DDL_Dist.SelectedValue + "'";
             DataSet ds     = SqlObj.selectAny(strSql);
             if (ds != null)
             {
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     DDL_Tah.DataSource     = ds.Tables[0];
                     DDL_Tah.DataTextField  = "Tehsilname";
                     DDL_Tah.DataValueField = "Tehsilno";
                     DDL_Tah.DataBind();
                     DDL_Tah.Items.Insert(0, "--Select--");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('" + ex.Message + "'); </script> ");
     }
 }
コード例 #2
0
    protected void GetTehsil()
    {
        SqlObj = new SqlString(ComObj);
        string  strSql = "select * from LR_TehsilMaster tm,DistrictMaster dm where dm.DistNo_LRMP=tm.Distno and dm.DistrictCode='" + DDL_Dist.SelectedValue + "'";
        DataSet ds     = SqlObj.selectAny(strSql);

        if (ds != null)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                DDL_Tah.DataSource     = ds.Tables[0];
                DDL_Tah.DataTextField  = "Tehsilname";
                DDL_Tah.DataValueField = "Tehsilno";
                DDL_Tah.DataBind();
                DDL_Tah.Items.Insert(0, "--Select--");
            }
        }
    }