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
699
1.3k
217.5k
Displaying ONLY the latest number...
Apr 2 2016 7:47 AM
Hi!
I wrote these codes I would like to know how can I show the latest number on my textbox
by order's number
after doing my search.
I need to inform that these codes work well but the only thing I am asking is to show me how can I display on my textbox ONLY the latest number concerning my search
by order's number
.
Here is my codes:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\LunaVisa\Visa\Visa\App_Data\visa.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from company where name='" + txtName.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
txtShowLastNumber.Text = read["Number"].ToString();
}
}
else
{
MessageBox.Show("The last number" + txtName.Text + " wasnt be found");
}
read.Close();
sqlCon.Close();
Reply
Answers (
4
)
Sql Server database or Visual Studio 2015 default database
sir I am making a project for collage's major project in vo