Hi!
How can I filter by order? I do try this but its doesnt works properly:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\lunaoffice\lunaoffice\\app_data\office.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from stock order by N_O where code ='" + txtCode.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
txtNumber.Text = read["number"].ToString();
txtProduct.Text = read["product"].ToString();
}
}
else
{
MessageBox.Show("This code " + txtCode.Text + " doenst exist");
}
read.Close();
sqlCon.Close();
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Apr 23, 2016, 7:25 AM EDT
Amit KumarRank #459 · 5.4K reputationPosted Apr 23, 2016, 7:26 AM EDT
Amit KumarRank #459 · 5.4K reputationPosted Apr 23, 2016, 8:15 AM EDT
IsraelRank #1,223 · 1.5K reputationPosted Apr 23, 2016, 8:11 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts