i have a gridview with project names with autogenerated select button when select button is selected bellow code is executed
- protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
- {
-
- lblProjectno.Text = GridView1.SelectedRow.Cells[1].Text;
-
- String s1 = lblProjectno.Text;
-
-
- SqlConnection con = new SqlConnection(ppd_Vas);
- con.Open();
- SqlCommand cmd = new SqlCommand("query'", con);
-
- cmd.Parameters.AddWithValue("@ProjectNo", s1);
- SqlDataAdapter da = new SqlDataAdapter(cmd);
-
-
- DataSet ds = new DataSet();
-
- da.Fill(ds);
-
- GridView2.DataSource = ds;
- GridView2.DataBind();
-
- con.Close();
-
- GridView5_Show();
- DisplayProject();
- Panelprojectdashboard1.Visible = true;
- Bindchart1();
- BindChart2();
-
-
-
- }
above code generates a gridview after selecting the select button
in above code i have mentioned a function call Gridview5_show()
code of Gridview5_show() is bellow
- protected void GridView5_Show()
- {
- string s1 = GridView1.SelectedRow.Cells[1].Text;
-
-
-
-
- SqlConnection con = new SqlConnection(ppd_Vas);
- con.Open();
-
- SqlCommand cmd = new SqlCommand("query ", con);
-
- cmd.Parameters.AddWithValue("@ProjectNo", s1);
- SqlDataAdapter da = new SqlDataAdapter(cmd);
-
- DataSet ds = new DataSet();
- da.Fill(ds);
- GridView5.DataSource = ds;
- GridView5.DataBind();
- con.Close();
-
-
- }
but when im selecting the select button it is showing error at line 17 da.Fill(ds);
error is : Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.