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
703
1.3k
215.5k
forced to display the very last record after search...
Oct 20 2015 5:39 AM
Hi!
Please I need urgently to display the
very last record
after search. I try this code but its doesnt do it.
I know that with this line of code for example its works:
dvgTest.CurrentCell = dvgTest.Rows[dvgTest.Rows.Count - 1].Cells[0];
But works only with datagrid. Then how can I make it work after my search:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Visa\App_Data\visa.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from bill where company='" + cbxMention2.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
txtMention21.Text = read["code"].ToString();
}
}
else
{
MessageBox.Show("This code " + txtMention21.Text + " doesnt exist");
}
read.Close();
sqlCon.Close();
Reply
Answers (
2
)
display text in textbox inside gridview
Saving in particular table based on dropdown item selection