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
mohaammed talha
NA
445
51.7k
It show an error : there is no row at the position
Jan 29 2021 10:50 AM
when the row is empty then its not move to another row and it show an error:there is no row at the position
public
void
loadAct()
{
string
qryAct =
""
;
DateNow = DateTime.Now.ToString(
"yyyy-MM-dd"
);
DataTable dt2 =
new
DataTable();
if
(txtDate.Text !=
""
)
{
qryAct =
"select Line, MAX(TotalPairs)Pairs from ProdHourlyRep where Date= '"
+ txtDate.Text +
"' and Team='C' group by Line"
;
}
else
{
qryAct =
"select Line, MAX(TotalPairs)Pairs from ProdHourlyRep where Date='"
+ DateNow +
"' and Team='C' group by Line"
;
}
SqlDataAdapter objAdapter2 =
new
SqlDataAdapter(qryAct, strConn);
objAdapter2.Fill(dt2);
if
(dt2.Rows.Count > 0)
{
lblActl1.Text = dt2.Rows[0][1].ToString();
lblActl2.Text = dt2.Rows[1][1].ToString();
lblActl3.Text = dt2.Rows[2][1].ToString();
//lblActl4.Text = dt2.Rows[3][1].ToString();
}
}
Reply
Answers (
4
)
Search from grid view and display multiple records
Enterprise Application Development