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
Israel
693
1.3k
219.5k
Forced to display to the label after last row selected
Jan 18 2018 2:03 PM
Hi!
Anyone can help please. I have these code and I need to display only the last row of datagrid on my label.
This first line it's works:
dgvNprint.CurrentCell = dgvNprint.Rows[dgvNprint.Rows.Count - 2].Cells[0];
the whole code:
...On Button_Click
dgvNprint.CurrentCell = dgvNprint.Rows[dgvNprint.Rows.Count - 2].Cells[0];
string
connectionString = @
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test\\table.mdb;Persist Security Info=False"
;
OleDbConnection sqlCon = newOleDbConnection(connectionString);
sqlCon.Open();
string
commandString =
"select * from companyname where S='order by ID"
+ '*
' + "'
";
OleDbCommand sqlCmd = newOleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
while
(read.Read())
{
lblNumberprint.Text = read[
"ID"
].ToString();
// it will show your friend's name
}
sqlCon.Close();
Reply
Answers (
5
)
What is a Friend class and friend attribute
How to group by tables in datatable and sum them using ER