Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Displaying ONLY the latest number...
Israel
Apr 2 2016 7:47 AM
400
Reply
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();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
how to know that patient has open the website more then one
windows forms