shifa Ali

shifa Ali

  • NA
  • 18
  • 2.7k

A parameter is passed through drop down show result in grid

Jul 2 2016 5:37 AM
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
con.Open();
query = "select * from OA_PlayerBat where Team_ID ='" + ddTeam.SelectedItem + "'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
grdResult.DataSource = ds;
grdResult.DataBind();
con.Close();
}
this is a drop-down list here user has to select the team to show the results of that team in a grid view. 
I have made a stored procedure and i am unable to pass the user selected drop down value there.

Answers (4)