TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Subin Thomas
NA
4.9k
125.8k
im getting an error when fetching data into gridview
Apr 30 2019 5:55 AM
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.
Reply
Answers (
9
)
how to connect ADMINLTE dashboard To database Using Webform
File Upload to host server issue in asp.net c# application