title: grid data according to drop down value
body: <p>I have drop down and grid view..i fill drop down from database like this</p>
  
  <p>There is two table <code>tblReg</code> and <code>tblRes</code>  both have RegionID</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
          {
              T1 tea = new T1();
              var list1 = tea.tblReg.ToList();
              var list = (from ta in list1
                          let data = ta.Region + " " + ta.StartDate ?? DateTime.Now.ToString() + " " + ta.EndDate ?? DateTime.Now.ToString()
                          select new { data, ta.RegionID }).ToList();
  
              if(!Page.IsPostBack)
              {
                  regiondrop.DataSource = list;
                  regiondrop.DataTextField = "data";
                  regiondrop.DataValueField = "RegionID";
                  regiondrop.DataBind();
  
              }
      }
  </code></pre>
  
  <p>now there is several values in drop down and i want when i select value from drop down then again to this value data will be display</p>
  
  <p>On dropdown SelectedIndexChange i done this </p>
  
  <pre><code> protected void regiondrop_SelectedIndexChanged(object sender, EventArgs e)
      {
          T1 ts = new T1();
  
          var dq=(from dropdwn in ts.tblRes
                 where dropdwn.RegionID==Convert.ToInt32(regiondrop.SelectedValue)
                 orderby dropdwn.OwnerName
                 select new {
                              FFID = dropdwn.FFID,
                              OwnerName = dropdwn.OwnerName,
                              RegNo = dropdwn.RegNo,
                              RegionID = dropdwn.RegionID,
  
                 });
          GridView1.DataSource = dq;
          GridView1.DataBind();
      }
  </code></pre>
  
  <p>when i select value from dropdown it shows error</p>
  
  <pre><code>LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.
  </code></pre>
  
  <p>on </p>
  
  <pre><code>GridView1.DataBind();
  </code></pre>
  
  <p>any solution                   </p>